67 lines
1.9 KiB
JSON
67 lines
1.9 KiB
JSON
{
|
|
"env": {
|
|
"node": true,
|
|
"es2022": true
|
|
},
|
|
"extends": [
|
|
"eslint:recommended",
|
|
"plugin:import/recommended"
|
|
],
|
|
"plugins": [
|
|
"import"
|
|
],
|
|
"parserOptions": {
|
|
"ecmaVersion": "latest",
|
|
"sourceType": "module"
|
|
},
|
|
"settings": {
|
|
"import/resolver": {
|
|
"node": {
|
|
"extensions": [
|
|
".js",
|
|
".mjs"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"rules": {
|
|
// Error prevention
|
|
"no-const-assign": "error",
|
|
"no-dupe-args": "error",
|
|
"no-dupe-keys": "error",
|
|
"no-duplicate-case": "error",
|
|
"no-unreachable": "error",
|
|
"valid-typeof": "error",
|
|
|
|
// Best practices
|
|
"eqeqeq": "error",
|
|
"no-eval": "error",
|
|
"no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
|
|
"no-var": "error",
|
|
"prefer-const": "error",
|
|
"no-empty": ["error", { "allowEmptyCatch": true }],
|
|
|
|
// Style
|
|
"indent": ["error", 4, { "SwitchCase": 1 }],
|
|
"linebreak-style": ["error", "unix"],
|
|
"quotes": ["error", "single"],
|
|
"semi": ["error", "always"],
|
|
"no-multiple-empty-lines": ["error", { "max": 1 }],
|
|
"no-trailing-spaces": "error",
|
|
"eol-last": "error",
|
|
"no-mixed-spaces-and-tabs": "error",
|
|
|
|
// Object and array formatting
|
|
"object-curly-spacing": ["error", "always"],
|
|
"array-bracket-spacing": ["error", "never"],
|
|
"comma-dangle": ["error", "never"],
|
|
|
|
// Import/Export
|
|
"import/no-duplicates": "error",
|
|
"import/order": ["error", {
|
|
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
|
|
"newlines-between": "always",
|
|
"alphabetize": { "order": "asc" }
|
|
}]
|
|
}
|
|
} |