broccoli-lint-eslint

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

Broccoli plugin to lint JavaScript files with ESLint as part of the build pipeline. Version 6.0.0 uses ESLint 6 (breaking change from earlier versions). Supports custom formatters, test generation (QUnit/Mocha), and options like throwOnError/throwOnWarn. Alternative to grunt-eslint, focused on Broccoli integration.

error TypeError: ESLint is not a constructor
cause Attempting to instantiate with `new ESLint()` instead of factory method.
fix
Use ESLint.create(inputNode, options).
error Error: Cannot find module 'eslint'
cause Missing `eslint` peer dependency.
fix
Run npm install eslint --save-dev.
breaking Version 6.0.0 drops support for ESLint <6 and Node <10.
fix Upgrade to ESLint 6 and Node 8+ (10+ recommended).
breaking Version 5.0.0 dropped Node 4 support and upgraded to ESLint 5.
fix Use Node 6+ and ESLint 5.
gotcha Must use `ESLint.create()` not `new ESLint()`.
fix Call `ESLint.create(inputNode, options)`.
gotcha Options passed inside `options` key are native ESLint CLIEngine options; top-level options are plugin-specific.
fix Place ESLint config under `options.options`.
npm install broccoli-lint-eslint
yarn add broccoli-lint-eslint
pnpm add broccoli-lint-eslint

Creates a Broccoli plugin instance to lint JavaScript files with ESLint, using a config file and optional test generation.

const ESLint = require('broccoli-lint-eslint');
const inputNode = 'app'; // path to source directory
const options = {
  format: 'stylish',
  options: {
    configFile: '.eslintrc.json'
  },
  throwOnError: true
};
const outputNode = ESLint.create(inputNode, options);
// outputNode is a Broccoli node containing linted files; for tests:
const testNode = ESLint.create(inputNode, {
  testGenerator: 'qunit',
  options: { configFile: '.eslintrc.json' }
});