grunt-eslint
    Overview
    Documentation
    Tutorials
    Insights
    Code
    Dependencies
    Contributors
    Jobs

grunt-eslint

Validate files with ESLint

22.0.0  •  Updated 9 months ago  •  by Sindre Sorhus  •  MIT License

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: {
			configFile: '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'

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)

Number of warnings to trigger non-zero exit code.

failOnError

Type: boolean
Default: true

Fail the build if ESLint found any errors.

Popularity

Weekly Downloads
78.1K
Stars
184

Maintenance

Development

Last ver 9 months ago
Created 7 years ago
Last commit 6 months ago
16 days between commits

Technology

Node version: 10.16.0
4.9K unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

25 contributors
Sindre Sorhus
Maintainer, 114 commits, 27 merges
Golo Roden
7 commits
Sam Verschueren
Maintainer, 1 commits, 1 merges
Jason Aller
2 commits, 3 PRs
makotot
2 commits, 2 PRs
David Petersen
2 commits, 2 PRs
Works at alchemyeng

Tags

gruntplugin
eslint
lint
validate
report
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
FacebookTwitterLinkedIn
© 2020 Devstore, Inc.