eslint-config-xo-overrides
v2.1.1
Published
eslint+xo sharable config with some opinionated rule overrides
Readme
eslint-config-xo-overrides
eslint+xo sharable config with some opinionated rule overrides
Note: Version 2.0.0+ uses ESLint's flat config format and requires ESLint 9.0.0 or higher.
Overrides
Trailing commas in multiline objects and arrays
This makes diffs simpler.
Correct :+1: code:
const fizz = {
blep: 'bloop',
};Space around object and array literals
Cause it looks better.
Correct :+1: code:
const { curly } = foo;
const bar = [ square ];No camelcase in property names
We still use objects as poor man's hashmaps.
Correct :+1: code:
const rates = {
eur_usd: 1,
};Linebreak before the operator
IMO reads better. Also makes diffs simpler.
Correct :+1: code:
return user.email
|| user.phone
|| user.slug;Other enabled rules
- unicorn/custom-error-definition - Enforce correct
Errorsubclassing.
Usage
Installation:
yarn add --dev eslint-config-xo-overridesor
npm install --save-dev eslint-config-xo-overridesWith XO (Recommended)
Use the included CLI tool to automatically create a xo.config.js file:
yarn eslint-config-xo-overrides
# or
./node_modules/.bin/eslint-config-xo-overridesThis will create a xo.config.js file with:
const xoOverrides = require('eslint-config-xo-overrides');
module.exports = xoOverrides;If you already have a xo.config.js file, manually add the config:
const xoOverrides = require('eslint-config-xo-overrides');
module.exports = [
...xoOverrides,
// Your other configs...
];With ESLint (Flat Config)
In your eslint.config.js:
const xoOverrides = require('eslint-config-xo-overrides');
module.exports = [
// Your other configs...
...xoOverrides,
];