Instruction on "Flow" installation
Copy files from previous step
cp -r ../009-rest-client/calc/ . && \
cd calc && \
yarn
Add Flow preset for babel
yarn add --dev @babel/preset-flow
Add preset to config/config.js
extraBabelPresets: [
"@babel/flow",
],
Install flow-bin
yarn add --dev flow-bin
Init flow
flow init
Add ignoring .*/node_modules/.* in .flowconfig
Check flow status
flow
Add // @flow to first lines of src/client/calculator.js, src/client/index.js and src/client/random.js
Check flow status again. There should be errors. Fix them.
flow
Check ui still works
yarn start
Add checking before commit in package.json
"husky": {
"hooks": {
"pre-commit": "npm run prettier && npm run lint-staged && flow"
}
}