spalger / gulp-jshint

JSHint plugin for gulp
MIT License
419 stars 65 forks source link

show error code as part of jshint error output #129

Closed ghost closed 8 years ago

ghost commented 8 years ago

Is it possible to see the jshint rule related to the thrown error, either by default or as config option?

for example, if the error is line 16 col 14 'cardPayment' is not defined.

it would also be helpful to see the error code as part of the output jshint -W117

Thanks and keep up the great work!

jansensan commented 8 years ago

Here are more details on what @obuckley-kenzan asked for: errors are currently listing the message, however not the message ID.

This happens in a unit test file where BardJS is used to inject values dynamically. This error message can be prevented by adding /* jshint -W117 */ at the top of the spec file.

The real issue here is that the error does not inform of what the error/message ID is, we have to know by heart what the textual message means, or go to the source code of JSHint to figure it out.

It would be nice if the ID could be provided in the logs, so that it is not so convoluted to figure out which one it is.

spalger commented 8 years ago

I know there is an option to enable this in jshint, not sure what it is right now. We could add support for that same option.

spalger commented 8 years ago

Looks like it's the verbose option, which is already supported. Just change your reporter to look like so: https://github.com/spalger/gulp-jshint#reporter-configuration

ghost commented 8 years ago

great, thank you @spalger ! Will give that a go