DEV Community

takundanashebmuchena-pixel
takundanashebmuchena-pixel

Posted on

Fix: babel-plugin-transform-flow-strip-types broken in Babel 7 and 8

The original babel-plugin-transform-flow-strip-types hasn't been updated in 9 years and breaks silently in Babel 7 and 8 environments.

The fix

I published a maintained fork that works as a drop-in replacement:

npm install --save-dev babel-plugin-transform-flow-strip-types-maintained

Then update your .babelrc:

{
"plugins": ["transform-flow-strip-types-maintained"]
}

That's it. No other changes needed.

What's fixed

  • Babel 7 and 8 peer dependency conflicts
  • Missing syntax plugin declaration
  • Deprecated visitor patterns
  • allowDeclareFields support

Automated migration

If you want to update your entire project automatically:

npx flow-strip-migrate .

This updates your package.json and babel config in one command.

More info: https://flowstrip.netlify.app
npm: https://www.npmjs.com/package/babel-plugin-transform-flow-strip-types-maintained

Top comments (1)

Collapse
 
hayrullahkar profile image
Hayrullah Kar

Maintaining and patching 9-year-old silent breakages in core Babel tooling is heavy lifter work. The automated migration script is a brilliant touch for legacy codebases. Solid engineering!