Babel plugin to convert Flow type annotations into TypeScript. Current stable version: 0.6.0. Release cadence is low (last release June 2018). Key differentiator: transforms Flow syntax (exact types, opaque types, $Keys, etc.) directly in Babel pipeline. No type inference, but covers most Flow constructs including maybe types, function types, object types, and utility types like $Diff and $Shape. Requires @babel/core ^7.4.4. Not actively maintained; no support for newer Flow features or TypeScript 3+ syntax.
npm install babel-plugin-flow-to-typescriptVerified import paths — ran on the pinned version, not inferred.
Converts a Flow function with maybe type (?string) to TypeScript union with null and undefined.
Update @babel/core to ^7.4.4 or later.
Consider using flow-to-typescript or a manual migration script for modern Flow/TypeScript.
Manually review imports after conversion; use type-only imports in TypeScript with 'import type'.
Replace $FlowFixMe comments with TypeScript's '// @ts-ignore' or proper types manually.
npm install --save-dev @babel/core@^7.4.4
Ensure plugin is installed and string name used in plugins array: 'babel-plugin-flow-to-typescript'
Add '@babel/preset-flow' or '@babel/plugin-syntax-flow' before this plugin in plugins array.