eslint-json

JSON formatter (reporter) for ESLint

eslint-json

JSON reporter for ESLint

Makes it easy to use ESLint with other tools.

$ npm install --save-dev eslint-json

Use it with:

$ eslint --format node_modules/eslint-json/json.js file.js

grunt-eslint

grunt.initConfig({
    eslint: {
        options: {
            format: require('eslint-json')
        },
        target: ['file.js']
    }
});
 
grunt.loadNpmTasks('grunt-eslint');
grunt.registerTask('default', ['eslint']);
{
    "results": [
        {
            "filePath": "test.js",
            "messages": [
                {
                    "ruleId": "no-undef",
                    "severity": 2,
                    "message": "'require' is not defined.",
                    "line": 2,
                    "column": 13,
                    "source": "require"
                }
            ]
        }
    ]
}

MIT © Sindre Sorhus