Sharable ESLint configurations used in our projects.
We assume that you already have eslint
package installed.
legacy
- default lint rules with some plugin extensions.- required libs:
babel-eslint eslint-plugin-import
,eslint-plugin-array-func
,eslint-plugin-functional
,eslint-plugin-simple-import-sort
- required libs for typescript:
@typescript-eslint/parser
,@typescript-eslint/eslint-plugin
- download command:
npm i -D babel-eslint eslint-plugin-import eslint-plugin-array-func eslint-plugin-functional eslint-plugin-simple-import-sort @typescript-eslint/parser @typescript-eslint/eslint-plugin
- required libs:
prettier
- prettier config for eslint.- required libs:
prettier
,eslint-config-prettier
,eslint-plugin-prettier
- download command:
npm i -D prettier eslint-config-prettier eslint-plugin-prettier
- required libs:
jest
- jest specific rules.- required libs:
eslint-plugin-jest
- download command:
npm i -D eslint-plugin-jest
- required libs:
react
- react specific rules with extensions.- required libs:
eslint-plugin-react
,eslint-plugin-react-hooks
- download command:
npm i -D eslint-plugin-react eslint-plugin-react-hooks
- required libs:
a11y
- jsx accessibility.- required libs:
eslint-plugin-jsx-a11y
- download command:
npm i -D eslint-plugin-jsx-a11y
- required libs:
Extending ALL configs via package.json
:
{
"eslintConfig": {
"extends": [
"@azimutlabs"
]
}
}
Extending configs separately:
{
"eslintConfig": {
"extends": [
"@azimutlabs/eslint-config/legacy",
"@azimutlabs/eslint-config/prettier",
"@azimutlabs/eslint-config/react"
]
}
}