Linter Flow Plus
apm install linter-flow-plus
A better linter plugin for Facebook’s Flow JS typechecker. It works on the fly.
How to use it
- Install flow
- Confirm the
linterpackage is installed and enabled for Atom.
- Create a .flowconfig file at the root of your repo. (You can use the
flow initcommand to do so)
- Install the linter-flow-plus package using the installer screen or the
- At the
/* @flow */to any JS file to enable on-the-fly flow linting when you code!
Please see the official flow website for details on how to install flow. My recommendation is to clone down the repo and build it yourself for the best ES6 support possible.
Why not X?
- A similarly named package: linter-flow is now a mirror. The development happens for both packages in parallel.
- IDE-flow works relatively well, but it doesn’t lint on-the-fly and doesn’t integrate with the linter package.
- Nuclide has too many problems for now to be reliable. It also involves installing a large number of other packages.
linter-flow-plus is made to be a simple package that does one thing well.
Please Note: IDE-flow and Nuclide provide other features such as autocomplete, type definitions on hover etc. Please continue to use those services for those features. (possibly in addition to linter-flow-plus)
linter-flow-plus has on-the-fly linting using flow types. It also provides clean errors with traces. (Only Nuclide’s trace support is based on the same code, and no other implementation exists currently)
This linter currently does not support Hack. Though the linter just uses the flow-cli and hack support should be trivial to add, I’m not a Hack/PHP developer and I can’t test that it actually works. I would welcome if someone was to add support for Hack to this package and test it.
This linter only works within files with the
/* @flow */ comment. Linter errors from other files are currently ignored and settings to lint all files without the comment are currently ignored. I would love some feedback to fix this issue.
If you open a project without
.flowconfig file with this linter enabled, you will get a dumb error on line 1, saying
Contribution and Feedback
This project started off as I was frustrated with IDE-flow and Nuclide. I hunted around in the flow-cli, made a PR to add documentation about it to their website, and create a few issues on Nuclide, and eventually, after seeing how straightforward writing a linter was, creating this linter over the night.
So please, make contributions and create github issues. In the issues, please complain about problems and missing features.