Babel plugin to transpile Flow type annotations to TypeScript, with a CLI wrapper for batch conversion. Current stable version 0.5.7 (latest). Development appears slow but active with periodic releases. Key differentiators: focuses on pretty output via Prettier, handles comments well, proven on real projects (27k and 41k LOC). Compared to alternatives like flow-to-ts or babel-plugin-flow-to-typescript, Reflow offers a CLI and better output formatting. Supports base types, generics, utility types, nullable types, optional chaining, nullish coalescing, and class decorator replacement. Limitation: empty Flow object types become `object` not `{}` since v0.5.
npm install babel-plugin-reflowVerified import paths — ran on the pinned version, not inferred.
Demonstrates CLI usage to transpile a directory and programmatic usage with Babel.
Manually replace `object` with `{}` in generated code if `{}` semantics required.Use `--exclude-patterns '**/node_modules/**'` instead.
Audit uses of `mixed` and add type guards or assertions as needed.
Review generated types for exact object semantics and add `Readonly` or `as const` as needed.
Manually replace with TypeScript equivalents or suppress errors.
Run `npm install --save-dev babel-plugin-reflow` or `yarn add --dev babel-plugin-reflow`.
Add `@babel/preset-flow` to your Babel presets before the Reflow plugin.
Either adjust TypeScript config to allow `object` or manually replace `object` with `{}`.Replace `--exclude-dirs` with `--exclude-patterns` and update the pattern syntax.