Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I continue using jshint with facebook flow?

I'm using http://jshint.com/ and also want to use http://flowtype.org/. As soon as I add static typing, jshint flips out because it doesn't understand the : Object part of function(options: Object).

Has anyone used jshint with Flow? I really like jshint and would prefer to continue using it along side of Flow.

like image 894
Alex K Avatar asked Sep 28 '22 18:09

Alex K


2 Answers

See this discussion on JSHint's GitHub: https://github.com/jshint/jshint/issues/2178

Sounds like they do not plan to support static typing until there is some shared spec or standard between the static type addons such as Flow and TypeScript. However, what I've been doing is running the Flow checker in my IDE, and then running JSHint on the type stripped output. I'm using Grunt to automate this.

like image 192
Alex K Avatar answered Oct 12 '22 10:10

Alex K


You can use eslint its great! You can use grunt-eslint with babel-eslint.

babel-eslint allows you to lint ALL valid Babel code with the fantastic ESLint.

And babel supports flow type annotations...

Just npm install babel-eslint and grunt-eslint in your project, and in .eslintrc file specify babel-eslint parser:

{
    "parser": "babel-eslint"
}
like image 38
Sava Jcript Avatar answered Oct 12 '22 10:10

Sava Jcript