No errors in Nuclide with Flow

358 Views Asked by At

I try to use Flow in my Nuclide installation but I can't see any diagnostics in my React-Native project. But running flow from cli results int 1000+ errors.

If I save a file the spinner in the bottom bar is spinning and then disappearing completely (no Idle).

.flowconfig

[ignore]

[include]

[libs]

[lints]

[options]

package.json

 "devDependencies": {
    "babel-cli": "^6.26.0",
    "babel-core": "^6.25.0",
    "babel-jest": "19.0.0",
    "babel-preset-flow": "^6.23.0",
    "babel-preset-react-native": "^1.9.1",
    "flow-bin": "^0.56.0",
    "jest": "19.0.2",
    "react-test-renderer": "15.4.2"
  },

My App.js

/* @flow */
Math.pow('X');
import boot from "./app/boot";
const app = boot();
export default app;

enter image description here

1

There are 1 best solutions below

1
Jon Eric Escobedo On

I too was experiencing frustrating issues with getting Nuclide Diagnostics to report Flow issues to show up in Atom.

Just as you mentioned, running Flow in the CLI would pick up errors, but nothing would show up in the IDE.

I came across your post a bit late, but here is what I did that (finally) did the trick.

1) Probably not necessary, though I did it anyway... I uninstalled Atom to the best of my ability following this post: https://discuss.atom.io/t/how-to-completely-uninstall-atom-for-mac/9084/42

2) I downloaded the latest version of Atom and installed it: https://atom.io/

3) I installed my linters first before installing Nuclide. This seemed to be what I was missing from all my other attempts. I ran apm install linter, apm install linter-eslint, and apm install linter-flow. I fired up Atom, allowed the IDE to install linter-ui-default, and then verified that Atom's own linter-flow was picking up Flow errors. Alas, it was! Good shape.

4) I then finally installed nuclide. When prompted with the choice of either disabling linter or atom-ide-diagnostics-ui to avoid duplicate linting issues, I chose to disable atom-ide-diagnostics-ui to verify that the IDE was still properly picking up Flow issues and fortunately, it was.

5) I then went and switched off linter and re-enabled atom-ide-diagnostics (Atom > Config > nuclide > use > "atom-ide-diagnostics-ui": true). To my huge surprise, everything was still linting and the Flow issues were now integrated into Atom using Nuclide's Diagnostic UI!

Here is a list of the packages I installed in pretty much chronological order:

├── [email protected] ├── [email protected] ├── [email protected] (disabled) ├── [email protected] ├── [email protected] ├── [email protected] └── [email protected]


Edit: Added a screenshot of my Nuclide settings

Nuclide settings

Good luck and I hope this helps some!