🌜
🌞
grunt-eslint

grunt-eslint

v24.0.0

Validate files with ESLint

npm install grunt-eslint

README

grunt-eslint

Validate files with ESLint

grunt 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.

Release Notes

24.0.0
By Sindre Sorhus • Published on October 15, 2021

Breaking

  • Upgrade to ESLint 8 (#171) dbaf9d5
  • Require Node.js 12 (#171) dbaf9d5
  • Due to ESLint changes, some of the options (the ones that are not documented in the readme here) have changed. For example, configFile changed to overrideConfigFile. Consult the ESLint docs for the available options.

https://github.com/sindresorhus/grunt-eslint/compare/v23.0.0...v24.0.0

23.0.0
By Sindre Sorhus • Published on May 18, 2020

Breaking

  • Upgrade to ESLint 7 (#167) a8f45f6
  • Require Node.js 10 (#167) a8f45f6

https://github.com/sindresorhus/grunt-eslint/compare/v22.0.0...v23.0.0

22.0.0
By Sindre Sorhus • Published on June 30, 2019

Breaking:

  • Upgrade to ESLint 6 7707f60
  • Require Node.js 8 7707f60

https://github.com/sindresorhus/grunt-eslint/compare/v21.1.0...v22.0.0

21.1.0
By Sindre Sorhus • Published on June 12, 2019
  • Bump the eslint version to 5.16.0 (#161) 7950891

https://github.com/sindresorhus/grunt-eslint/compare/v21.0.0...v21.1.0

5.1.0
By Sindre Sorhus • Published on January 25, 2015

Added an outputFile option to output the report to a file instead of the terminal.

5.0.0
By Sindre Sorhus • Published on January 25, 2015

The task has been rewritten to use the ESLint CLIEngine which fixed most of the open issues.

The use of the CLIEngine brings you some useful new options.

The config option was renamed to configFile and rulesdir was renamed to rulePaths to conform to the CLIEngine options. Old ones still works, but will be removed sometime in the future.

ESLint was also updated.

Fixed issues: #16 #22 #29 #33 #34

Changes: https://github.com/sindresorhus/grunt-eslint/compare/v4.0.0...v5.0.0

General

License
MIT
Typescript Types
None found
Tree-shakeable
No

Popularity

GitHub Stargazers
198
Community Interest
319
Number of Forks
70

Maintenance

Commits
10/219/2203
Last Commit
Open Issues
5
Closed Issues
100
Open Pull Requests
0
Closed Pull Requests
35

Versions

Versions Released
10/219/2201
Latest Version Released
Oct 15, 2021
Current Tags
latest24.0.0

Dependencies

Dependencies (2)
Dev Dependencies (3)

Contributors

sindresorhus
sindresorhus
Commits: 99
ex1st
ex1st
Commits: 2
petersendidit
petersendidit
Commits: 2
makotot
makotot
Commits: 2
ChristianMurphy
ChristianMurphy
Commits: 2
jraller
jraller
Commits: 2
iudelsmann
iudelsmann
Commits: 1
a-laughlin
a-laughlin
Commits: 1
jsturgis
jsturgis
Commits: 1
manicki
manicki
Commits: 1
mohayonao
mohayonao
Commits: 1
ntwb
ntwb
Commits: 1
enure
enure
Commits: 1
mightyiam
mightyiam
Commits: 1
matz3
matz3
Commits: 1