-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy path.eslintrc.json
78 lines (71 loc) · 2.69 KB
/
.eslintrc.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
"extends": [
// Prettier presets are partial "anti-presets" for other presets, that disable unnecessary/conflicting rules.
/*
* Enable all rules:
* 1. Majority of rules and default options are good
* 2. eslint:recommended is only a small subset
* 3. We automatically gain new rules when they are released
*/
"eslint:all",
"prettier",
// Need to be specific, because this config is one level above the package.jsons that have type:module
"plugin:n/recommended-module"
],
"plugins": ["import"],
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
"env": {
"es2021": true,
"node": true
},
"reportUnusedDisableDirectives": true,
"rules": {
// eslint:all - Disable unwanted rules. Add appropriate others as and when they're discovered.
"capitalized-comments": "off",
"global-require": "off",
"init-declarations": "off",
"line-comment-position": "off",
"multiline-comment-style": "off",
"no-eq-null": "off",
"no-inline-comments": "off",
"no-magic-numbers": "off",
"no-plusplus": "off",
"no-ternary": "off",
"no-undefined": "off",
"one-var": "off",
"sort-imports": "off", // using import/order instead
"sort-keys": "off",
"strict": "off",
// eslint:all - Modify default options
"eqeqeq": ["error", "always", { "null": "never" }],
"func-names": ["error", "as-needed"],
"func-style": ["error", "declaration"],
"id-length": ["error", { "exceptions": ["_", "a", "b", "i"] }],
"no-unused-vars": ["error", { "ignoreRestSiblings": true }],
"no-use-before-define": ["error", "nofunc"],
"spaced-comment": ["error", "always", { "block": { "balanced": true } }],
// eslint:all & prettier - Re-enable some of the rules that are compatible when certain options are used
// (https://github.com/prettier/eslint-config-prettier#special-rules)
"curly": "error",
"max-len": ["error", { "code": 1000, "comments": 90, "ignoreUrls": true }],
"quotes": [
"error",
"single",
{ "avoidEscape": true, "allowTemplateLiterals": false }
],
// eslint:all - Rules whose default options do nothing. Options need to be compatible with Prettier.
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "*", "next": ["cjs-export"] },
{ "blankLine": "always", "prev": "*", "next": "block-like" },
{ "blankLine": "always", "prev": "block-like", "next": "*" }
],
// eslint-plugin-import - selection (not comprehensive)
"import/newline-after-import": "error",
"import/no-extraneous-dependencies": "error",
"import/order": ["error", { "newlines-between": "never" }]
}
}