Flycheck checker for Flow
Yesterday Facebook open sourced Flow, a static type checker for Javascript. If you use Emacs, you can use Flycheck to check your .js files on the fly using Flow.
Here is the checker definition I use:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(flycheck-define-checker javascript-flow | |
"A JavaScript syntax and style checker using Flow. | |
See URL `http://flowtype.org/'." | |
:command ("flow" source-original) | |
:error-patterns | |
((error line-start | |
(file-name) | |
":" | |
line | |
":" | |
(minimal-match (one-or-more not-newline)) | |
": " | |
(message (minimal-match (and (one-or-more anything) "\n"))) | |
line-end)) | |
:modes js-mode) |
I prefer to use Flow after gjslint, so I define the following, too:
(flycheck-add-next-checker 'javascript-gjslint 'javascript-flow)
Enjoy!