babel-plugin-transform-flow-strip-types — abandoned 9 years ago

Fix your broken
Flow build today.

The original babel-plugin-transform-flow-strip-types hasn't shipped an update in 9 years. It breaks silently with Babel 7 and 8. Here's the drop-in fix — and a one-command migration path.

→ Get the fix npm package migration CLI
Terminal — 30-second fix
# Option A: swap the package (drop-in, 30 seconds)
npm remove babel-plugin-transform-flow-strip-types
npm install -D babel-plugin-transform-flow-strip-types-maintained

# Option B: automated migration (updates package.json + .babelrc)
npx flow-strip-migrate .

# Option C: full Flow→TypeScript strip + config update
npx flow-strip-migrate . --full
The problem in numbers

2M+ downloads/week.
Zero active maintenance.

2M+
weekly npm downloads
945
dependent packages
9 yrs
since last update
0
active maintainers
What's broken

Why it fails in Babel 7/8

Bug

Peer dependency conflict

The package declares babel-core v6 as a peer dependency. Babel 7 ships as @babel/core, causing npm/yarn to flag unresolvable conflicts or install silently broken versions.

Bug

Missing syntax plugin declaration

Babel 7 requires plugins to explicitly declare their syntax dependencies. The old package doesn't, causing SyntaxError: Unexpected token on Flow-typed files in certain configurations.

Bug

Deprecated visitor patterns

The original uses visitor patterns deprecated in Babel 7.x that produce warnings — and are outright broken in Babel 8's stricter AST validation.

Fixed

All resolved in the maintained fork

The maintained fork fixes every known issue: correct peer deps, explicit syntax plugin, updated visitors, allowDeclareFields support, and import type / export type stripping.

Migration

Three ways to migrate

01

Drop-in package swap (manual, 2 mins)

Replace the old package with the maintained fork in package.json and update your .babelrc. Full instructions in the README.

02

Automated config migration (CLI, 30 secs)

Run npx flow-strip-migrate . — it updates your package.json, .babelrc, and all Babel config files automatically. No source code changes.

03

Full Flow annotation strip (CLI --full)

Run npx flow-strip-migrate . --full to also strip @flow pragmas, type annotations, and import type statements from all source files. Ideal for teams moving away from Flow entirely.

.babelrc change
// Before
{
  "plugins": ["transform-flow-strip-types"]
}

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

Free forever.
Pro for teams.

Open Source
$0
forever
  • Maintained npm package
  • Babel 7 + 8 compatibility fixes
  • Basic migration CLI
  • Community support (GitHub Issues)
Get started free