{"id":20073,"library":"grunt-eslint","title":"grunt-eslint","description":"Grunt plugin to validate JavaScript files using ESLint. Current stable version is 26.0.0 (requires Node.js 20+ and Grunt >=1). Releases are feature-driven with major version bumps when ESLint or Node.js requirements change. Key differentiators: seamless integration with Grunt, supports both flat and legacy ESLint configs (flat is default since v25), dual console and file output (v26+), and feature flags for experimental ESLint features. Maintained by Sindre Sorhus with regular updates across major ESLint versions (6, 7, 8, 9).","status":"active","version":"26.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/sindresorhus/grunt-eslint","tags":["javascript","gruntplugin","eslint","lint","validate","report"],"install":[{"cmd":"npm install grunt-eslint","lang":"bash","label":"npm"},{"cmd":"yarn add grunt-eslint","lang":"bash","label":"yarn"},{"cmd":"pnpm add grunt-eslint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; grunt-eslint is a Grunt plugin and requires Grunt >=1 to run tasks.","package":"grunt","optional":false}],"imports":[{"note":"The grunt-eslint package does not export any symbols; it registers the 'eslint' Grunt task. Use grunt.loadNpmTasks('grunt-eslint') or a loader like load-grunt-tasks.","wrong":"grunt.config('eslint', { options: {} });","symbol":"grunt-eslint (Grunt task)","correct":"grunt.initConfig({ eslint: { target: ['file.js'] } });"},{"note":"load-grunt-tasks is a convenience package that auto-loads all grunt plugins. It's not required but commonly used.","wrong":"grunt.loadTasks('node_modules/grunt-eslint/tasks');","symbol":"load-grunt-tasks (optional loader)","correct":"require('load-grunt-tasks')(grunt);"},{"note":"Since v25, flat config is the default. Use 'extends' option with an array of configs. For legacy configs, set ESLINT_USE_FLAT_CONFIG environment variable to false.","wrong":"grunt.initConfig({ eslint: { options: { configFile: '.eslintrc' } }, target: ['file.js'] });","symbol":"ESLint config (flat config)","correct":"grunt.initConfig({ eslint: { options: { extends: [js.configs.recommended] } }, target: ['file.js'] });"}],"quickstart":{"code":"// Install: npm install --save-dev grunt-eslint\n\nmodule.exports = function(grunt) {\n  require('load-grunt-tasks')(grunt);\n\n  grunt.initConfig({\n    eslint: {\n      options: {\n        extends: [require('@eslint/js').configs.recommended],\n        format: 'stylish',\n        quiet: false,\n        maxWarnings: -1,\n        failOnError: true\n      },\n      target: ['src/**/*.js', 'test/**/*.js']\n    }\n  });\n\n  grunt.registerTask('lint', ['eslint']);\n  grunt.registerTask('default', ['lint']);\n};","lang":"javascript","description":"Gruntfile.js example: registers eslint task, configures with recommended flat config, lints source and test JS files, runs via 'grunt lint' or 'grunt'."},"warnings":[{"fix":"Upgrade Node.js to version 20 or later.","message":"Requires Node.js 20+ (v26.0.0)","severity":"breaking","affected_versions":">=26.0.0"},{"fix":"Migrate to flat config (e.g., use 'extends' option) or set ESLINT_USE_FLAT_CONFIG=false environment variable to use non-flat config (legacy).","message":"Flat config is now required by default (v25.0.0)","severity":"breaking","affected_versions":">=25.0.0"},{"fix":"Add silent: true to options if you want output only to file (old behavior).","message":"outputFile option now also outputs to console (v26.0.0). Use silent: true to suppress console output.","severity":"gotcha","affected_versions":">=26.0.0"},{"fix":"Consult ESLint 8 documentation for options. In v24, overrideConfigFile replaces configFile. For v25+, use flat config 'extends'.","message":"Upgrade to ESLint 8 (v24.0.0): some options changed (e.g., configFile renamed to overrideConfigFile).","severity":"breaking","affected_versions":">=24.0.0 <25.0.0"},{"fix":"Check https://eslint.org/docs/developer-guide/nodejs-api for current ESLint options.","message":"Options not documented in grunt-eslint README may have changed across ESLint versions. Always refer to ESLint Node.js API docs for available options.","severity":"gotcha","affected_versions":">=24.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run: npm install --save-dev eslint","cause":"ESLint is not installed as a dependency (grunt-eslint does not include eslint internally; it must be installed separately).","error":"Loading \"grunt-eslint.js\" tasks...ERROR >> Error: Cannot find module 'eslint'"},{"fix":"Add grunt.loadNpmTasks('grunt-eslint'); to Gruntfile, or use a task loader like load-grunt-tasks.","cause":"grunt-eslint not loaded; missing grunt.loadNpmTasks('grunt-eslint') or equivalent autoloader.","error":"Warning: Task \"eslint\" not found. Use --force to continue."},{"fix":"Ensure structure: grunt.initConfig({ eslint: { options: { ... }, target: ['files'] } });","cause":"Incorrect Grunt configuration; options for eslint are not properly nested under the target.","error":"Fatal error: Invalid options in eslint task. Expected a configuration object, but got something else."},{"fix":"Run: npm install --save-dev @eslint/js","cause":"Flat config requires @eslint/js package for recommended configs, but it's not installed.","error":"Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}