eslint-config-xo-typescript-overrides
v2.0.3
Published
eslint+xo sharable config with some opinionated rule overrides
Downloads
166
Readme
eslint-config-xo-typescript-overrides
eslint+xo sharable config with some opinionated rule overrides
Note: Version 2.0.0+ uses ESLint's flat config format. For the legacy ESLint config format, use version 1.x.
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-typescript-overrides
yarn eslint-config-xo-typescript-overridesor
npm install --save-dev eslint-config-xo-typescript-overrides
./node_modules/.bin/eslint-config-xo-typescript-overridesThis will install the package and create an xo.config.ts file in your project root:
import tsOverrides from 'eslint-config-xo-typescript-overrides';
export default [
...tsOverrides,
];Manual Configuration
If you prefer to configure manually:
For XO
Create an xo.config.ts file:
import tsOverrides from 'eslint-config-xo-typescript-overrides';
export default [
...tsOverrides,
// Your additional configurations
];For ESLint Flat Config
In your eslint.config.js:
const tsOverrides = require('eslint-config-xo-typescript-overrides');
module.exports = [
...tsOverrides,
// Your additional configurations
];