Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.7 KB

CONTRIBUTING.md

File metadata and controls

38 lines (26 loc) · 1.7 KB

Contributing to flow2dts

We greatly appreciate feedback, bug reports, and pull-requests; just make sure they adhere to Microsoft’s Code of Conduct.

Setup

git clone https://github.com/microsoft/flow2dts.git
cd flow2dts
yarn install

Iterate

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

When needing to patch a package

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.)

Helpful resources

  • 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.
    1. Select language JavaScript
    2. Select parser @babel/parser
    3. Select from the parser’s settings either Flow or TypeScript.