Registry / testing / eslint-config-webpack

eslint-config-webpack

JSON →
library4.9.5jsnpmunverified

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.

npm install eslint-config-webpack
INSTALL
IMPORT
SIG · ESLINT-CONFIG-WEBP
E
eslint-config-webpack
testingjavascriptv4.9.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import config from 'eslint-config-webpack';
const config = require('eslint-config-webpack');
Package uses ESM and provides a flat config object. CommonJS require() will not work because the package is ESM-only.
defineConfig
import { defineConfig } from 'eslint/config';
defineConfig is from the eslint package itself, not from eslint-config-webpack.

Shows how to extend the webpack ESLint config in a flat config file with browser and Node globals.

// eslint.config.js import { defineConfig } from 'eslint/config'; import config from 'eslint-config-webpack'; import globals from 'globals'; export default defineConfig([ { extends: [config], languageOptions: { globals: { ...globals.browser, ...globals.node, }, }, }, ]);
Debug
Known issues
breakingv4.x introduced flat config (eslint.config.js) and dropped support for legacy .eslintrc files
fix
Migrate to eslint.config.js using extends with the provided config object.
affects: >=4.0.0
breakingRequires Node >=20.9.0
fix
Upgrade Node to v20.9.0 or later.
affects: >=4.9.0
breakingRequires ESLint >=9.28.0
fix
Upgrade ESLint to v9.28.0 or later.
affects: >=4.9.0
deprecatedTypeScript peer dependency: ^4.8.4 || ^5.0.0 || ^6.0.0 (future) but actual releases may enforce <7.0.0
fix
Install TypeScript matching the peer range; v4.8.4+ or v5.x is supported.
affects: >=4.8.5
gotchaThe default export is a flat config object, not an array. Using it directly without extending may cause linting issues if you need multiple configs.
fix
Wrap it in defineConfig or spread into an array when using multiple config objects.
affects: >=4.0.0
gotchaThe package does not include react preset by default; you may need to install additional plugins (e.g., eslint-plugin-react) if using React.
fix
Install react-related plugins and add them to your config manually.
affects: all
Errors
Common errors & fixes
Cannot find module 'eslint-config-webpack'
Package not installed or used in legacy ESLint config file (e.g., .eslintrc)
fix
Run 'npm i -D eslint-config-webpack' and use import in eslint.config.js flat config.
ESLint: Failed to load config "webpack" to extend from
Using string 'webpack' in extends instead of imported config object
fix
Import the config and use extends: [config] instead of extends: ['webpack'].
require() of ES Module /path/to/node_modules/eslint-config-webpack/index.js from ... not supported
Using CommonJS require() for an ESM-only package
fix
Use import() or set "type": "module" in your package.json.
Upgrade
Version history
4.9.5latest on npm
Audit
Dependencies
eslintrequiredpeer dependency: ESLint flat config required
typescriptoptionalpeer dependency for TypeScript support
Agent activity
2 hits · last 30 days
node
2
Resources