Skip to content

Commit

Permalink
docs: update Flow documentation (#7550)
Browse files Browse the repository at this point in the history
* docs: update Flow documentation

* Update adding-flow.md

* Update adding-flow.md
  • Loading branch information
FezVrasta authored and iansu committed Aug 16, 2019
1 parent 6466282 commit 24780bb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions docusaurus/docs/adding-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@ To add Flow to a Create React App project, follow these steps:
3. Run `npm run flow init` (or `yarn flow init`) to create a [`.flowconfig` file](https://flow.org/en/docs/config/) in the root directory.
4. Add `// @flow` to any files you want to type check (for example, to `src/App.js`).

Now you can run `npm run flow` (or `yarn flow`) to check the files for type errors.
You can optionally use an IDE like [Nuclide](https://nuclide.io/docs/languages/flow/) for a better integrated experience.
In the future we plan to integrate it into Create React App even more closely.
Now you can run `npm run flow` (or `yarn flow`) to check the files for type errors.
You can optionally enable an extension for your IDE, such as [Flow Language Support](https://github.com/flowtype/flow-for-vscode) for Visual Studio Code, or leverage the Language Server Protocol standard (e.g. [vim LSP](https://github.com/prabirshrestha/vim-lsp/wiki/Servers-Flow)) to get hints while you type.

If you'd like to use [absolute imports](/docs/importing-a-component#absolute-imports) with Flow,
make sure to add the following line to your `.flowconfig` to make Flow aware of it:

```diff
[options]
+ module.name_mapper='^\(.*\)$' -> '<PROJECT_ROOT>/src/\1'
```

To learn more about Flow, check out [its documentation](https://flow.org/).

0 comments on commit 24780bb

Please sign in to comment.