gruntify-eslint

raw JSON →
5.0.0 verified Sat Apr 25 auth: no javascript

Grunt plugin for ESLint that lints JavaScript files using the ESLint engine. Current stable version is 5.0.0, which supports ESLint 5.x. Release cadence follows ESLint major versions with breaking changes. Differentiators: integrates ESLint into Grunt workflows, supports custom config files, rule paths, formatters, silent mode, maxWarnings, outputFile, and a callback for post-processing results.

error Task 'eslint' not found
cause grunt.loadNpmTasks('gruntify-eslint') missing or typo in task name.
fix
Add grunt.loadNpmTasks('gruntify-eslint') to your Gruntfile.
error Error: Cannot find module 'gruntify-eslint'
cause Missing npm install of gruntify-eslint as devDependency.
fix
Run npm install --save-dev gruntify-eslint
error Warning: No files found. Use --force to continue.
cause The src pattern matches no files or the property is misconfigured.
fix
Ensure src is an array of glob patterns that match existing files.
breaking Version 4.0.0 drops support for ESLint 3.x; requires ESLint 4.x or later.
fix Update to ESLint 4.x or later.
breaking Version 3.0.0 drops support for ESLint 2.x; requires ESLint 3.x or later.
fix Update to ESLint 3.x or later.
breaking Version 2.0.0 drops support for ESLint 1.x; requires ESLint 2.x or later.
fix Update to ESLint 2.x or later.
gotcha The task name is 'eslint', not 'gruntify-eslint'. Using the wrong name in grunt.loadNpmTasks or initConfig will fail.
fix Use grunt.loadNpmTasks('gruntify-eslint') and task name 'eslint'.
gotcha Options like silent, maxWarnings, callback, terminateOnCallback, outputFile are not passed to ESLint API; they are handled by the plugin itself.
fix Use these options only in grunt config, not in ESLint configuration files.
npm install gruntify-eslint
yarn add gruntify-eslint
pnpm add gruntify-eslint

Install and configure gruntify-eslint with a basic eslint task that lints JavaScript files.

// Install: npm install --save-dev grunt gruntify-eslint eslint
// Gruntfile.js
module.exports = function(grunt) {
  grunt.initConfig({
    eslint: {
      target: {
        src: ['**/*.js', '!node_modules/**']
      }
    }
  });
  grunt.loadNpmTasks('gruntify-eslint');
  grunt.registerTask('default', ['eslint']);
};