Skip to content

futpib/eslint-config-xo-overrides

Repository files navigation

eslint-config-xo-overrides

eslint+xo sharable config with some opinionated rule overrides

Overrides

Trailing commas in multiline objects and arrays

This makes diffs simpler.

Correct 👍 code:

const fizz = {
  blep: 'bloop',
};

Space around object and array literals

Cause it looks better.

Correct 👍 code:

const { curly } = foo;
const bar = [ square ];

No camelcase in property names

We still use objects as poor man's hashmaps.

Correct 👍 code:

const rates = {
	eur_usd: 1,
};

Linebreak before the operator

IMO reads better. Also makes diffs simpler.

Correct 👍 code:

return user.email
	|| user.phone
	|| user.slug;

Other enabled rules

Usage

Installation:

yarn add --dev eslint-config-xo-overrides
yarn eslint-config-xo-overrides

or

npm install --save-dev eslint-config-xo-overrides
./node_modules/.bin/eslint-config-xo-overrides

This will install the package and add the following to your package.json:

{
  "xo": {
    "extends": ["eslint-config-xo-overrides"]
  }
}