A eslint config for best practice.
npm install eslint @nice-move/eslint-config-base --save-dev
Add to package.json
// example: package.json
{
"eslintConfig": {
"extends": "@nice-move/eslint-config-base"
}
}
Then run
eslint --fix .
Environment | pattern |
---|---|
browser | .js , .html |
node.js | .mjs , .mts , .cjs , .cts |
es modules | .mjs , .mts , .js , .html |
commonjs | .cjs , source code in webpack project |
webpack | src/** , packages/*/** |
ava | {test,tests,spec,specs}/** , **/*.{test,spec}.* when eslint-plugin-ava installed |
Rules can handle by prettier and garou is disabled by default.