brunch / jshint-brunch

Adds JSHint linting support to Brunch.
7 stars 4 forks source link

Jshint errors #9

Closed loadx closed 10 years ago

loadx commented 10 years ago

See thread: https://github.com/brunch/jshint-brunch/commit/fb012cc4268b8610a59e097e5bc6ca69f5556d89#commitcomment-4708675

Errors will return as such: https://gist.github.com/loadx/7667431

es128 commented 10 years ago

Can you suppress the warning if the error is that the file is missing? Also, you should test a malformed .jshintrc file, as that's the entire motivation behind adding this.

Also, why aren't newlines being inserted between errors in the second example?

es128 commented 10 years ago

Jumped the gun on me there @paulmillr :smile:

loadx commented 10 years ago

The errors's i'll admit are a little verbose when options are bad in the jshintrc file but unless we throw not much I think we can do about it without buffering the whole report and parsing it back out...which would be slow.

See the second line of the gist, that's a file with a bad option.. syntax error's are almost identical. I can update the gist with one if you'd prefer though?

es128 commented 10 years ago

Oh ok, I misinterpreted. Yes that's fine on the second example.

But what if it's not even valid JSON?

And I don't think we ought to be warning about a missing .jshintrc file, but I can make that tweak.

loadx commented 10 years ago

Gist updated, see the comment :)

If you for example made a jshintrc file that was an array not an object it's a very similar error. The parser will just die on the first character it doesn't like.

es128 commented 10 years ago

Cool. Looks good. Thanks for all your contributions on this @loadx. You too @jas.

loadx commented 10 years ago

All good man, I appreciate all the feedback from both yourself, @paulmillr and @jas. Enjoy