{"id":19621,"library":"eslint-config-webpack","title":"ESLint Config Webpack","description":"Webpack's official ESLint configuration as a shareable config for projects using ESLint 9+ flat config. Version 4.9.5 requires Node >=20.9.0, ESLint >=9.28.0, and TypeScript >=4.8.4 <7.0.0. It provides TypeScript support, regexp rules, and JSDoc type formatting. Actively maintained by the Webpack team with frequent updates. Unlike generic configs like eslint-config-airbnb, it is tailored for webpack ecosystem projects.","status":"active","version":"4.9.5","language":"javascript","source_language":"en","source_url":"https://github.com/webpack/eslint-config-webpack","tags":["javascript","eslint","eslintconfig","config","webpack","typescript"],"install":[{"cmd":"npm install eslint-config-webpack","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-webpack","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-webpack","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: ESLint flat config required","package":"eslint","optional":false},{"reason":"peer dependency for TypeScript support","package":"typescript","optional":true}],"imports":[{"note":"Package uses ESM and provides a flat config object. CommonJS require() will not work because the package is ESM-only.","wrong":"const config = require('eslint-config-webpack');","symbol":"default","correct":"import config from 'eslint-config-webpack';"},{"note":"defineConfig is from the eslint package itself, not from eslint-config-webpack.","wrong":"","symbol":"defineConfig","correct":"import { defineConfig } from 'eslint/config';"}],"quickstart":{"code":"// eslint.config.js\nimport { defineConfig } from 'eslint/config';\nimport config from 'eslint-config-webpack';\nimport globals from 'globals';\n\nexport default defineConfig([\n  {\n    extends: [config],\n    languageOptions: {\n      globals: {\n        ...globals.browser,\n        ...globals.node,\n      },\n    },\n  },\n]);","lang":"javascript","description":"Shows how to extend the webpack ESLint config in a flat config file with browser and Node globals."},"warnings":[{"fix":"Migrate to eslint.config.js using extends with the provided config object.","message":"v4.x introduced flat config (eslint.config.js) and dropped support for legacy .eslintrc files","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Upgrade Node to v20.9.0 or later.","message":"Requires Node >=20.9.0","severity":"breaking","affected_versions":">=4.9.0"},{"fix":"Upgrade ESLint to v9.28.0 or later.","message":"Requires ESLint >=9.28.0","severity":"breaking","affected_versions":">=4.9.0"},{"fix":"Install TypeScript matching the peer range; v4.8.4+ or v5.x is supported.","message":"TypeScript peer dependency: ^4.8.4 || ^5.0.0 || ^6.0.0 (future) but actual releases may enforce <7.0.0","severity":"deprecated","affected_versions":">=4.8.5"},{"fix":"Wrap it in defineConfig or spread into an array when using multiple config objects.","message":"The default export is a flat config object, not an array. Using it directly without extending may cause linting issues if you need multiple configs.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Install react-related plugins and add them to your config manually.","message":"The package does not include react preset by default; you may need to install additional plugins (e.g., eslint-plugin-react) if using React.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm i -D eslint-config-webpack' and use import in eslint.config.js flat config.","cause":"Package not installed or used in legacy ESLint config file (e.g., .eslintrc)","error":"Cannot find module 'eslint-config-webpack'"},{"fix":"Import the config and use extends: [config] instead of extends: ['webpack'].","cause":"Using string 'webpack' in extends instead of imported config object","error":"ESLint: Failed to load config \"webpack\" to extend from"},{"fix":"Use import() or set \"type\": \"module\" in your package.json.","cause":"Using CommonJS require() for an ESM-only package","error":"require() of ES Module /path/to/node_modules/eslint-config-webpack/index.js from ... not supported"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}