grunt-eslint

    24.0.0 • Public • Published

    grunt-eslint

    Validate files with ESLint

    Install

    npm install --save-dev grunt-eslint

    Usage

    require('load-grunt-tasks')(grunt);
    
    grunt.initConfig({
    	eslint: {
    		target: ['file.js']
    	}
    });
    
    grunt.registerTask('default', ['eslint']);

    Examples

    Custom config and rules

    grunt.initConfig({
    	eslint: {
    		options: {
    			overrideConfigFile: 'conf/eslint.json',
    			rulePaths: ['conf/rules']
    		},
    		target: ['file.js']
    	}
    });

    Custom formatter

    grunt.initConfig({
    	eslint: {
    		options: {
    			format: require('eslint-tap')
    		},
    		target: ['file.js']
    	}
    });

    Options

    See the ESLint options.

    In addition the following options are supported:

    format

    Type: string
    Default: 'stylish'

    The name of a built-in formatter or path to a custom one.

    Some formatters you might find useful: eslint-json, eslint-tap.

    outputFile

    Type: string
    Default: ''

    Output the report to a file.

    quiet

    Type: boolean
    Default: false

    Report errors only.

    maxWarnings

    Type: number
    Default: -1 (Means no limit)

    The nmber of warnings to trigger non-zero exit code.

    failOnError

    Type: boolean
    Default: true

    Fail the build if ESLint found any errors.

    Install

    npm i grunt-eslint

    DownloadsWeekly Downloads

    121,828

    Version

    24.0.0

    License

    MIT

    Unpacked Size

    5.11 kB

    Total Files

    4

    Last publish

    Collaborators

    • sindresorhus