eslint-config-defaults
raw JSON → 9.0.0 verified Sat Apr 25 auth: no javascript abandoned
A composable set of ESLint configurations by WalmartLabs. Version 9.0.0 provides ready-to-use configs for ESLint, Google, Gulp, Node.js runtime, AirBnB (es5, es6, es6-react), and Walmart (es5/es6, browser/node/test/react). It also offers piecemeal rule files for custom setups. Dependencies include eslint-plugin-filenames for Walmart configs, and eslint-plugin-react and babel-eslint for React/ES6 configs. Last updated 2016, currently unmaintained.
Common errors
error Error: Cannot find module 'eslint-config-defaults/rules/eslint/best-practices' ↓
cause Using wrong path or not having the package installed.
fix
Ensure eslint-config-defaults is installed: npm install --save-dev eslint-config-defaults. Then require the correct file, e.g., require('eslint-config-defaults/rules/eslint/best-practices').
error Configuration for rule 'no-console' is invalid: Value "warn" is not a valid severity. ↓
cause Using old ESLint config format (string 'warn' instead of number 1).
fix
Use integer severity: 0 = off, 1 = warn, 2 = error.
error ESLint couldn't find the config "defaults" to extend from. ↓
cause Config package not installed or not specified correctly in extends.
fix
Install eslint-config-defaults and ensure the extends value is 'defaults' (not 'eslint-config-defaults').
Warnings
breaking Extending multiple complete configs can cause unexpected results ↓
fix Use piecemeal configs instead of extending multiple full configs. See https://github.com/walmartlabs/eslint-config-defaults/issues/38
deprecated Package is unmaintained since 2016, may not work with recent ESLint versions. ↓
fix Switch to maintained alternatives like eslint-config-airbnb or eslint-config-standard.
gotcha Walmart configs require eslint-plugin-filenames, but peer dependency is not listed in package.json ↓
fix Manually install eslint-plugin-filenames: npm install --save-dev eslint-plugin-filenames
gotcha ES6 configs require babel-eslint, but it's not listed as a peer dependency ↓
fix Manually install babel-eslint: npm install --save-dev babel-eslint
Install
npm install eslint-config-defaults yarn add eslint-config-defaults pnpm add eslint-config-defaults Imports
- defaults wrong
extends: ['eslint-config-defaults']correctextends: ['defaults'] - defaults/configurations/walmart/es6-browser wrong
extends: ['walmart/es6-browser']correctextends: ['defaults/configurations/walmart/es6-browser'] - rules wrong
const rules = require('eslint-config-defaults/rules');correctnpm install eslint-config-defaults; then require('eslint-config-defaults/rules/eslint/best-practices') in .eslintrc
Quickstart
// Install: npm install --save-dev eslint eslint-config-defaults
// .eslintrc.yaml
---
extends:
- "defaults"
- "defaults/configurations/walmart/es6-browser"
// Or piecemeal: .eslintrc.yaml
---
rules:
eqeqeq: "error"
no-console: "warn"
# ... and more from require('eslint-config-defaults/rules/eslint/best-practices')