How to setup react native to use flow?
Asked Answered
C

2

17

I was wondering how I have to setup .flowConfig in order to use flow on a React- Native project. I created an empty .flowConfig file but as soon as I include the react-native module in a JS source file and check this file with flow, flow displays a 'not_found' error message.

Childbed answered 9/4, 2015 at 17:17 Comment(0)
D
4

Follow the instructions on https://flowtype.org/ to create your projects .flowconfig file, you can copy and paste it, you also have to install flow via brew install flow and add the flow binaries to your package.json, once you've done all this, you should be able to manually run flow and check for error types, but, that is not really optimal.

I haven't been able to set up flow on atom without using nuclide, I'm guessing with some digging around the packages you can find something that works that allows for on-the-fly flow checking.

The link provided by @jerome (https://egghead.io/lessons/react-setup-nuclide-to-use-flow-and-eslint-mac) is useful but only for nuclide installation, still worth a watch.

Derringdo answered 13/10, 2016 at 14:39 Comment(0)
B
1

I advise to watch https://egghead.io/lessons/react-setup-nuclide-to-use-flow-and-eslint-mac it explains how to use Flow with Nuclide. I had issue to make flow works and my main mistake was that I didn't install flow (brew install flow). On the official site (https://flowtype.org/docs/getting-started.html) they don't mention you need to install flow (or it is not super obvious if it is the case). Anyway watch the video it is great, it even explains ESLint :)

Brazen answered 26/9, 2016 at 7:25 Comment(1)
actually the correct way to install flow globally is not with homebrew (as only a few version of flow are available) but with "npm install -g [email protected]" (use the version mentioned in your .flowconfig)Brazen

© 2022 - 2024 — McMap. All rights reserved.