[![CircleCI](https://circleci.com/gh/Khan/flow-to-ts.svg?style=svg)](https://circleci.com/gh/Khan/flow-to-ts) [![codecov](https://codecov.io/gh/Khan/flow-to-ts/branch/master/graph/badge.svg)](https://codecov.io/gh/Khan/flow-to-ts)
Last updated 8 months ago by khell .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @khell/flow-to-ts 
SYNC missed versions from official npm registry.


CircleCI codecov

Convert Flow code to TypeScript.

The goal of this project is to provide a tool that can translate 95% of Flow to TypeScript while maintaining a high percentage of the existing type information. We don't want to convert code and end up with everything using any. We also want to avoid having to make a lot of manual changes to files afterwards, e.g. changing SyntheticEvent to React.Event.

Quick start

  • yarn global add @khanacademy/flow-to-ts
  • flow-to-ts [options] <file globs>




  • when exact translation isn't possible:
    • downgrade to any when possible and provide a gentle warning
    • when it isn't possible to downgrade (e.g. %checks), remove the syntax and provide a forceful warning that the code in question will need a human to convert it manually.
  • best effort to maintain blank lines and the position comments, this isn't always possible so warn in those situations where we can't, e.g. converting object type spreads to intersection types.



Bug reports for converting Flow to TypeScript should include a link to the playground with an example of a minimal reproducible example of the bug.

Feature Requests

Feature requests are welcome.

Pull Requests

Please make sure there is a GitHub issue first before creating a pull request except for small things. Also, please sign our Contributor License Agreement.

Pull requests that fix a bug in the conversion code should include one or more test cases and should have 100% diff coverage.

Dev quick start

  • git clone git@github.com:Khan/flow-to-ts.git
  • cd flow-to-ts
  • yarn
  • yarn test

Helpful resources

Current Tags

  • 0.3.0                                ...           latest (8 months ago)

9 Versions

  • 0.3.0                                ...           8 months ago
  • 0.2.0                                ...           8 months ago
  • 0.1.11                                ...           a year ago
  • 0.1.10                                ...           a year ago
  • 0.1.9                                ...           a year ago
  • 0.1.8                                ...           a year ago
  • 0.1.7                                ...           a year ago
  • 0.1.6                                ...           a year ago
  • 0.1.5                                ...           a year ago
Maintainers (1)
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (12)
Dev Dependencies (20)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |