Skip to content

Commit 24780bb

Browse files
FezVrastaiansu
authored andcommitted
docs: update Flow documentation (#7550)
* docs: update Flow documentation * Update adding-flow.md * Update adding-flow.md
1 parent 6466282 commit 24780bb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

docusaurus/docs/adding-flow.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@ To add Flow to a Create React App project, follow these steps:
1414
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.
1515
4. Add `// @flow` to any files you want to type check (for example, to `src/App.js`).
1616

17-
Now you can run `npm run flow` (or `yarn flow`) to check the files for type errors.
18-
You can optionally use an IDE like [Nuclide](https://nuclide.io/docs/languages/flow/) for a better integrated experience.
19-
In the future we plan to integrate it into Create React App even more closely.
17+
Now you can run `npm run flow` (or `yarn flow`) to check the files for type errors.
18+
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.
19+
20+
If you'd like to use [absolute imports](/docs/importing-a-component#absolute-imports) with Flow,
21+
make sure to add the following line to your `.flowconfig` to make Flow aware of it:
22+
23+
```diff
24+
[options]
25+
+ module.name_mapper='^\(.*\)$' -> '<PROJECT_ROOT>/src/\1'
26+
```
2027

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

0 commit comments

Comments
 (0)