@sergiogc9/eslint-config v1.0.12
Eslint personal config
Table of contents
Configurations available
This package contains some different eslint configurations:
@sergiogc9/eslint-config:Contains the base rules for
typescriptandjavascriptwith the recommended ones together withairbnbrules, as well as withprettierrules.@sergiogc9/eslint-config/react:Contains
reactspecific rules together with reacthooksrules defined by Airbnb. React v16.8 must be used at least.@sergiogc9/eslint-config/jest:Contains settings related to
jesttesting. Don't use it if not using jest.@sergiogc9/eslint-config/all:Contains all the available configurations together.
Installation
Install package
Using yarn:
yarn add -D @sergiogc9/eslint-configUsing npm:
npm install -D @sergiogc9/eslint-configPeer dependencies
Install all needed plugins and configs:
npx install-peerdeps --dev @sergiogc9/eslint-configℹ️ The command above will install all needed dependencies from all eslint configs. If you don't use react, jest or don't want to install some of these configs, install only dependencies related to each package:
- Dependencies for base config (and the others config):
yarn add -D \
eslint \
@typescript-eslint/eslint-plugin \
eslint-plugin-eslint-comments \
eslint-plugin-import \
eslint-plugin-prettier \
prettier- Dependencies for react config:
yarn add -D \
eslint-plugin-jsx-a11y \
eslint-plugin-react \
eslint-plugin-react-hooks- Dependencies for jest config:
yarn add -D eslint-plugin-jestUsage
Add the wanted configuration(s) inside the .eslintrc file in extends option:
{
...,
extends: [
"other_config",
"@sergiogc9/eslint-config"
]
}E.g. if you want react rules but not jest ones:
{
...,
extends: [
"other_config",
"@sergiogc9/eslint-config",
"@sergiogc9/eslint-config/react"
]
}E.g. if you want all rules available in this package:
{
...,
extends: [
"other_config",
"@sergiogc9/eslint-config/all"
]
}