New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

grunt-eslint

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-eslint

Validate files with ESLint

latest
Source
npmnpm
Version
26.0.0
Version published
Weekly downloads
141K
7.22%
Maintainers
1
Weekly downloads
 
Created
Source

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

const noAlertRule = require('./conf/rules/no-alert');

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

Using shared configs

const js = require('@eslint/js');

grunt.initConfig({
	eslint: {
		options: {
			extends: [js.configs.recommended]
		},
		target: ['file.js']
	}
});

Custom formatter

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

Output to both console and file

grunt.initConfig({
	eslint: {
		options: {
			outputFile: 'eslint-results.xml',
			format: 'checkstyle'
		},
		target: ['file.js']
	}
});

This will output in checkstyle format to both the console and eslint-results.xml. To suppress console output and only write to the file, add silent: true.

Using feature flags

grunt.initConfig({
	eslint: {
		options: {
			flags: ['v10_config_lookup_from_file']
		},
		target: ['../project1/scripts/**/*.js']
	}
});

Options

See the ESLint options.

In addition the following options are supported:

extends

Type: array | object

Requires ESLint 9.22+

Shareable configs to extend.

flags

Type: array

Feauture flags to pass to ESLint.

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. When specified, the report is written to both the console and the file unless silent is true.

quiet

Type: boolean
Default: false

Report errors only.

silent

Type: boolean
Default: false

Suppress console output. When used with outputFile, only writes to the file.

maxWarnings

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

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

failOnError

Type: boolean
Default: true

Fail the build if ESLint found any errors.

Keywords

gruntplugin

FAQs

Package last updated on 10 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts