- contains all rules
- almost all rules enabled
- this config is highly opinionated
- anywhere
- for tests better to add
env:"node"and disablenewline-per-chained-callrule
- install latest
npm$(sudo) npm install -g npm@latest - add task
eslinttopackage.jsonscriptsection"eslint": "./node_modules/.bin/eslint --ignore-path .gitignore --ext js --fix . .config", - add linting to tests step
scriptspackage.jsonsection"test": "npm run eslint && ..."
- create
.eslintrc.jsonnear to youpackage.jsonwith the following content{ "extends": "./node_modules/eslint-config-valorsoft/.eslintrc.json", "env": { "node": true } } - run
npm tto check that all is working correctly
no-eq-null- duplicateseqeqeq:smartno-restricted-imports,no-restricted-modules,no-restricted-globals- dependant on project requirementsid-match- not found any particular use of this rule,camelCaseis enoughjsx-quotes- I don't use jsx so I don't careno-plusplus- why not++? It's nice to use when you know what you are doingno-restricted-syntax- duplicatesno-withand disabled functional expressionsno-ternary- why not? but not nested ternary pleaserequire-jsdoc- nice thing, but hard to followspaced-comment- nice for meaningful comments, bad for quick code commentingwrap-regex- no needprefer-reflect- compatibility is to low to usenewline-before-return- TBD
indent- 2 spaces rulezzz!max-len- extended to 120 charsnewline-per-chained-call- extendedignoreChainWithDepthto 3eqeqeq-smartmode enableddot-location-propertymode enabledno-implicit-coercion- boolean implicit coercion enabledfunc-style-declarationonly pleaseno-use-before-define- usage offunctionbefore declarations are allowedno-mixed-requires-groupingandallowCallchecks enabledlinebreak-style- unix onlyone-var-neveruse onevar|let|constper blockpadded-blocks-neveradd useless paddingquote-props- quote properties onlyas-neededandkeywordsno-magic-numbers-ignore-1,0,1as most often used numbers andignoreArrayIndexes,enforceConstare enabled
- what I really appreciate is configs for IDEs
- to change any rule you should have strong arguments and not only opinion