@babel/preset-flow
"babel": { "presets": [ "react-app", "@babel/preset-flow" ] },
npm i flow-bin
"flow": "flow"
npm run flow init
It will create a .flowconfig file in root directory.
npm run flow
It will start a continuos server which will watch files included in .flowconfig or files that start with //@flow. To stop the server simply use
npm run flow stop
Note: To write types in .js files in VS Code go to setting.json and add the following line "javascript.validate.enable": false
npm i flow-typed
"flow-typed": "flow-typed"
npm run flow-types install <package name>
This will create a flow-typed directory and files will present in npm directory inside it.
Note: Move all the type definition files that are under npm directory to directly under flow-typed directory.