From 3a50c4b3b341604f7a65f178e9dad0e99ee551c4 Mon Sep 17 00:00:00 2001 From: Federico Zivolo Date: Fri, 16 Aug 2019 17:04:46 +0200 Subject: [PATCH 1/3] docs: update Flow documentation --- docusaurus/docs/adding-flow.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docusaurus/docs/adding-flow.md b/docusaurus/docs/adding-flow.md index a495a6cc677..f4b5c7e9d2e 100644 --- a/docusaurus/docs/adding-flow.md +++ b/docusaurus/docs/adding-flow.md @@ -14,8 +14,14 @@ 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](https://create-react-app.dev/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='^\(.*\)$' -> '/src/\1' +``` To learn more about Flow, check out [its documentation](https://flow.org/). From 73e94f270d12a8f99ad466cdce37717bd0f4d640 Mon Sep 17 00:00:00 2001 From: Federico Zivolo Date: Fri, 16 Aug 2019 17:08:26 +0200 Subject: [PATCH 2/3] Update adding-flow.md --- docusaurus/docs/adding-flow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/adding-flow.md b/docusaurus/docs/adding-flow.md index f4b5c7e9d2e..4eac9934ab4 100644 --- a/docusaurus/docs/adding-flow.md +++ b/docusaurus/docs/adding-flow.md @@ -16,7 +16,7 @@ To add Flow to a Create React App project, follow these steps: 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](https://create-react-app.dev/docs/importing-a-component#absolute-imports) with Flow, +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 From de63b41dca10722517e90c22909fdc8ac0d0fe10 Mon Sep 17 00:00:00 2001 From: Federico Zivolo Date: Fri, 16 Aug 2019 17:24:41 +0200 Subject: [PATCH 3/3] Update adding-flow.md --- docusaurus/docs/adding-flow.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docusaurus/docs/adding-flow.md b/docusaurus/docs/adding-flow.md index 4eac9934ab4..570d88a22bb 100644 --- a/docusaurus/docs/adding-flow.md +++ b/docusaurus/docs/adding-flow.md @@ -14,7 +14,8 @@ 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 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. +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: