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.

rogergl
  • 3,501
  • 2
  • 30
  • 49

2 Answers2

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.

Oscar Franco
  • 5,691
  • 5
  • 34
  • 56
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 :)

Jerome Mouneyrac
  • 363
  • 2
  • 10
  • 2
    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 flow-bin@0.38.0" (use the version mentioned in your .flowconfig) – Jerome Mouneyrac Mar 21 '17 at 14:14