JSON reporter for ESLint
Makes it easy to use ESLint with other tools.
$ npm install --save-dev eslint-json
$ eslint --format=node_modules/eslint-json file.js
grunt.initConfig({
eslint: {
options: {
format: 'node_modules/eslint-json'
},
target: ['file.js']
}
});
grunt.loadNpmTasks('grunt-eslint');
grunt.registerTask('default', ['eslint']);
[
{
"filePath": "/Users/sindresorhus/dev/eslint-json/index.js",
"messages":[
{
"ruleId": "no-warning-comments",
"severity": 1,
"message": "Unexpected 'todo' comment.",
"line": 8,
"column": 2,
"nodeType": "Line",
"source": "\t// TODO: fix this later"
}
],
"errorCount": 0,
"warningCount": 1
}
]
MIT © Sindre Sorhus