ESLint Webpack Plugin
raw JSON → 6.0.0 verified Sat Apr 25 auth: no javascript
A webpack plugin that integrates ESLint into the webpack build process, linting JavaScript files during compilation. Current stable version is 6.0.0, released April 2026. Requires webpack 5 and ESLint 9+. Key changes: v5 switched to flat config by default, v6 dropped threads option, removed ESLint 8 and Node.js 18 support. Official plugin from webpack organization, ships TypeScript types, supports caching and auto-fix. Distinguished by seamless webpack integration vs standalone ESLint usage.
Common errors
error Error: Cannot find module 'eslint-webpack-plugin' ↓
cause Package not installed or not in node_modules.
fix
Run 'npm install eslint-webpack-plugin --save-dev' or 'yarn add -D eslint-webpack-plugin'.
error Error: [eslint-webpack-plugin] Failed to load ESLint: ESLint version must be >=9 ↓
cause Installed ESLint version is too old (e.g., v8).
fix
Upgrade ESLint to v9+ with 'npm install eslint@latest --save-dev'.
error Error: [eslint-webpack-plugin] The 'threads' option has been removed in v6 ↓
cause Used 'threads' option which was removed in v6.
fix
Remove 'threads' from plugin options.
error Error: No ESLint configuration found ↓
cause No .eslintrc or eslint.config.js file found, or configType mismatch.
fix
Create an eslint.config.js (flat) or .eslintrc.* (eslintrc) file and set configType appropriately.
Warnings
breaking v5 defaults to flat config ('configType': 'flat'). eslintrc configs no longer work by default. ↓
fix Set configType: 'eslintrc' in plugin options, or migrate to flat config format (eslint.config.js).
breaking v5 requires Node.js >=18.12.0 and ESLint >=9. Previous versions with ESLint 8 are incompatible. ↓
fix Upgrade Node.js to 18.12+ and ESLint to 9+. For ESLint 8 stay on v4.
breaking v6 removed the 'threads' option entirely. ↓
fix Remove 'threads' from plugin options. Threading is no longer supported.
gotcha The 'fix' option modifies source files in place. Use with caution in version control. ↓
fix Set fix: false (default) or ensure you have backups / git stash before enabling.
gotcha If using eslintrc configuration, you must set configType: 'eslintrc' otherwise plugin ignores eslintrc files. ↓
fix Explicitly pass configType: 'eslintrc' in plugin options.
Install
npm install eslint-webpack-plugin yarn add eslint-webpack-plugin pnpm add eslint-webpack-plugin Imports
- ESLintPlugin wrong
const ESLintPlugin = require('eslint-webpack-plugin')correctimport ESLintPlugin from 'eslint-webpack-plugin' - ESLintPlugin (type)
import type { ESLintPlugin } from 'eslint-webpack-plugin' - Options
import type { Options } from 'eslint-webpack-plugin'
Quickstart
import ESLintPlugin from 'eslint-webpack-plugin';
export default {
plugins: [new ESLintPlugin({
files: 'src/**/*.{js,ts}',
fix: true,
cache: true,
cacheLocation: 'node_modules/.cache/eslint-webpack-plugin/.eslintcache'
})]
};