Skip to content

Instantly share code, notes, and snippets.

@hnrchrdl
Last active December 21, 2019 06:52
Show Gist options
  • Save hnrchrdl/eaa6afb87702af205d4026ed56c0105e to your computer and use it in GitHub Desktop.
Save hnrchrdl/eaa6afb87702af205d4026ed56c0105e to your computer and use it in GitHub Desktop.
Create new Project with Create-React-App with Flow and VSCode support

1. Create new app

npx create-react-app myapp

2. Edit workspace settings in vscode for flow typechecking

{
  "flow.useNPMPackagedFlow": true,
  "javascript.validate.enable": false
}

Make sure you have flow addon installed (called flowtype.flow-for-vscode)

3.Install flow to your project

If you use create-reat-app, here is a guide for this step.

yarn add -D flow-bin
yarn run flow init

4. Install jest flow types

Find version of jest

npx jest -v

Install typings for jest, e.g.

npx flow-typed install jest@22

5. Register flow-typed in config

In your .flowconfig, add flow-typed to libs section.

...
[libs]
flow-typed
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment