We greatly appreciate feedback, bug reports, and pull-requests; just make sure they adhere to Microsoft’s Code of Conduct.
git clone https://github.com./microsoft/flow2dts.git
cd flow2dts
yarn install
After making changes, be sure to test them with:
yarn test
…and while the React Native typings still exist in this repo, update them or ensure no unexpected changes occur:
yarn workbench
We make liberal use of patch-package to make local changes to packages that need to be sent upstream before a new release of the tool can be made. (Or, worst case, it should alternatively be decided to make use of a forked package instead.)
- Babel Plugin Handbook which documents how to use Babel's tooling to transform AST.
- AST Explorer which allows you to easily inspect the Babel AST of both Flow and TypeScript code, making it trivial to know what AST node types to visit and what AST node types to transform it to.
For instance, here’s some Flow source and the expected converted TypeScript ambient declaration.
- Select language
JavaScript
- Select parser
@babel/parser
- Select from the parser’s settings either
Flow
orTypeScript
.
- Select language