JSHint reporter that displays absolute path with row/column on one line
npm install jshint-path-reporter
$ npm install jshint-path-reporter
``
Then pass the module as the reporter option (see JSHINT docs)
For usage in grunt-contrib-jshint use the reporter option; for example merge it with your .jshintrc options:
``
grunt.initConfig({
//..
jshint: {
options: grunt.util._.defaults(grunt.file.readJSON('.jshintrc'), {
reporter: './node_modules/jshint-path-reporter'
}),
//..
}
});
``
You can globally disable ANSI colouring:
``
require('jshint-path-reporter').color(false);
``
Example output
``
Linting ERROR at D:\projects\jshint-path-reporter\test\fail.js(2,1)
W117: 'undeclaredVar' is not defined.
undeclaredVar = 123;
Linting ERROR at D:\projects\jshint-path-reporter\test\fail.js(4,1)
W061: eval can be harmful.
eval('123');
JSHint found 2 errors
```