Code Monkey home page Code Monkey logo

linter-flow's Introduction

linter-flow

A better linter plugin for Facebook's Flow JS typechecker. It works on the fly.

linter-demo

How to use it

  1. Install flow
  2. Confirm the linter package is installed and enabled for Atom.
  3. Create a .flowconfig file at the root of your repo. (You can use the flow init command to do so)
  4. Install the linter-flow package using the installer screen or the apm cli.
  5. 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?

  1. A similarly named package: linter-flow-plus is now a mirror. The development happens for both packages in parallel.
  2. IDE-flow works relatively well, but it doesn't lint on-the-fly and doesn't integrate with the linter package.
  3. Nuclide has too many problems for now to be reliable. It also involves installing a large number of other packages.

linter-flow 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)

features

linter-flow 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)

Limitations

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.

Known issues

If you open a project without .flowconfig file with this linter enabled, you will get a dumb error on line 1, saying Error Linting.

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.

Since then, I depend on this linter on a daily basis for all my Javascript development, and so I maintain this project. There are a few rough edges and I would love some help to fix them.

So please, make contributions and create github issues. In the issues, please complain about problems and missing features.

linter-flow's People

Contributors

anaisbetts avatar nmn avatar kevinsawicki avatar martomi avatar despairblue avatar maletor avatar torifat avatar steelbrain avatar

Stargazers

Angus H. avatar Michael Anthony avatar

Watchers

Michael Anthony avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.