Configuration for ESLint
- Provide Errors and Warnings
- 4 spaces for indentation (warning)
- 90 symbols per line (warning)
- Unix linebreaks (warning)
Install eslint
and @dopustim/eslint-config
packages via NPM:
npm install -D eslint @dopustim/eslint-config
Extend this config in your .eslintrc.json
:
{
"extends": "@dopustim/eslint-config"
}
Or use your package.json
:
"eslintConfig": {
"extends": "@dopustim/eslint-config"
}
You can also set environment and reassign any rule for your needs:
{
"extends": "@dopustim/eslint-config",
"env": {
"browser": true,
"es2020": true,
"node": true
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2020
},
"rules": {
"max-len": [ 1, { "code": 100 } ]
}
}
Visit the ESLint website to find out all rules and descriptions.