{"id":20013,"library":"eslint-webpack-plugin","title":"ESLint Webpack Plugin","description":"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.","status":"active","version":"6.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/webpack/eslint-webpack-plugin","tags":["javascript","eslint","lint","linter","plugin","webpack","typescript"],"install":[{"cmd":"npm install eslint-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency - ESLint is the linter engine","package":"eslint","optional":false},{"reason":"Peer dependency - runs as a webpack plugin","package":"webpack","optional":false}],"imports":[{"note":"Package is ESM-only since v3. For CommonJS use createRequire or dynamic import.","wrong":"const ESLintPlugin = require('eslint-webpack-plugin')","symbol":"ESLintPlugin","correct":"import ESLintPlugin from 'eslint-webpack-plugin'"},{"note":"TypeScript users can import the type for type-checking options.","symbol":"ESLintPlugin (type)","correct":"import type { ESLintPlugin } from 'eslint-webpack-plugin'"},{"note":"The Options type is exported for TypeScript plugin configuration.","symbol":"Options","correct":"import type { Options } from 'eslint-webpack-plugin'"}],"quickstart":{"code":"import ESLintPlugin from 'eslint-webpack-plugin';\n\nexport default {\n  plugins: [new ESLintPlugin({\n    files: 'src/**/*.{js,ts}',\n    fix: true,\n    cache: true,\n    cacheLocation: 'node_modules/.cache/eslint-webpack-plugin/.eslintcache'\n  })]\n};\n","lang":"typescript","description":"Shows how to add ESLint webpack plugin with cache and auto-fix enabled, targeting TypeScript and JavaScript files."},"warnings":[{"fix":"Set configType: 'eslintrc' in plugin options, or migrate to flat config format (eslint.config.js).","message":"v5 defaults to flat config ('configType': 'flat'). eslintrc configs no longer work by default.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Upgrade Node.js to 18.12+ and ESLint to 9+. For ESLint 8 stay on v4.","message":"v5 requires Node.js >=18.12.0 and ESLint >=9. Previous versions with ESLint 8 are incompatible.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Remove 'threads' from plugin options. Threading is no longer supported.","message":"v6 removed the 'threads' option entirely.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Set fix: false (default) or ensure you have backups / git stash before enabling.","message":"The 'fix' option modifies source files in place. Use with caution in version control.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Explicitly pass configType: 'eslintrc' in plugin options.","message":"If using eslintrc configuration, you must set configType: 'eslintrc' otherwise plugin ignores eslintrc files.","severity":"gotcha","affected_versions":">=5.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 eslint-webpack-plugin --save-dev' or 'yarn add -D eslint-webpack-plugin'.","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'eslint-webpack-plugin'"},{"fix":"Upgrade ESLint to v9+ with 'npm install eslint@latest --save-dev'.","cause":"Installed ESLint version is too old (e.g., v8).","error":"Error: [eslint-webpack-plugin] Failed to load ESLint: ESLint version must be >=9"},{"fix":"Remove 'threads' from plugin options.","cause":"Used 'threads' option which was removed in v6.","error":"Error: [eslint-webpack-plugin] The 'threads' option has been removed in v6"},{"fix":"Create an eslint.config.js (flat) or .eslintrc.* (eslintrc) file and set configType appropriately.","cause":"No .eslintrc or eslint.config.js file found, or configType mismatch.","error":"Error: No ESLint configuration found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}