Khan / flow-to-ts

Convert flow code to typescript
https://flow-to-ts.netlify.com
393 stars 75 forks source link

flow-to-ts

Actions Status codecov npm version

Convert Flow code to TypeScript.

:warning: This is a WIP and many things still do not work properly. There may also be the odd regression from time to time as work progresses.

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

For a comprehensive list of available options, please check out the CLI code.

Playground

https://flow-to-ts.netlify.com

Principles

Contributing

Bugs

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
git submodule update --depth 1 --init -- babel
cd babel
yarn
cd ..
yarn
yarn test

Helpful resources