eslint-config-complete 3.2.4 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base/base-complete.js +40 -40
- package/dist/base/base-eslint.d.ts.map +1 -1
- package/dist/base/base-eslint.js +145 -126
- package/dist/base/base-import-x.js +24 -24
- package/dist/base/base-jsdoc.d.ts.map +1 -1
- package/dist/base/base-jsdoc.js +34 -32
- package/dist/base/base-n.js +9 -9
- package/dist/base/base-stylistic.d.ts.map +1 -1
- package/dist/base/base-stylistic.js +8 -3
- package/dist/base/base-typescript-eslint.d.ts.map +1 -1
- package/dist/base/base-typescript-eslint.js +113 -113
- package/dist/base/base-unicorn.js +129 -129
- package/dist/eslint-plugin.js +30 -30
- package/package.json +3 -3
|
@@ -11,46 +11,46 @@ export const baseComplete = defineConfig({
|
|
|
11
11
|
complete: ESLintPluginComplete,
|
|
12
12
|
},
|
|
13
13
|
rules: {
|
|
14
|
-
"complete/complete-sentences-jsdoc": "
|
|
15
|
-
"complete/complete-sentences-line-comments": "
|
|
16
|
-
"complete/consistent-enum-values": "
|
|
17
|
-
"complete/consistent-named-tuples": "
|
|
18
|
-
"complete/eqeqeq-fix": "
|
|
19
|
-
"complete/format-jsdoc-comments": "
|
|
20
|
-
"complete/format-line-comments": "
|
|
21
|
-
"complete/jsdoc-code-block-language": "
|
|
22
|
-
"complete/newline-between-switch-case": "
|
|
23
|
-
"complete/no-confusing-set-methods": "
|
|
24
|
-
"complete/no-empty-jsdoc": "
|
|
25
|
-
"complete/no-empty-line-comments": "
|
|
26
|
-
"complete/no-explicit-array-loops": "
|
|
27
|
-
"complete/no-explicit-map-set-loops": "
|
|
28
|
-
"complete/no-for-in": "
|
|
29
|
-
"complete/no-let-any": "
|
|
30
|
-
"complete/no-mutable-return": "
|
|
31
|
-
"complete/no-number-enums": "
|
|
32
|
-
"complete/no-object-any": "
|
|
33
|
-
"complete/no-object-methods-with-map-set": "
|
|
34
|
-
"complete/no-string-length-0": "
|
|
35
|
-
"complete/no-template-curly-in-string-fix": "
|
|
36
|
-
"complete/no-undefined-return-type": "
|
|
37
|
-
"complete/no-unnecessary-assignment": "
|
|
38
|
-
"complete/no-unsafe-plusplus": "
|
|
39
|
-
"complete/no-useless-return": "
|
|
40
|
-
"complete/no-void-return-type": "
|
|
41
|
-
"complete/prefer-const": "
|
|
42
|
-
"complete/prefer-plusplus": "
|
|
43
|
-
"complete/prefer-postfix-plusplus": "
|
|
44
|
-
"complete/prefer-readonly-parameter-types": "
|
|
45
|
-
"complete/require-break": "
|
|
46
|
-
"complete/require-capital-const-assertions": "
|
|
47
|
-
"complete/require-capital-read-only": "
|
|
48
|
-
"complete/require-unannotated-const-assertions": "
|
|
49
|
-
"complete/require-variadic-function-argument": "
|
|
50
|
-
"complete/strict-array-methods": "
|
|
51
|
-
"complete/strict-enums": "
|
|
52
|
-
"complete/strict-undefined-functions": "
|
|
53
|
-
"complete/strict-void-functions": "
|
|
14
|
+
"complete/complete-sentences-jsdoc": "error",
|
|
15
|
+
"complete/complete-sentences-line-comments": "error",
|
|
16
|
+
"complete/consistent-enum-values": "error",
|
|
17
|
+
"complete/consistent-named-tuples": "error",
|
|
18
|
+
"complete/eqeqeq-fix": "error",
|
|
19
|
+
"complete/format-jsdoc-comments": "error",
|
|
20
|
+
"complete/format-line-comments": "error",
|
|
21
|
+
"complete/jsdoc-code-block-language": "error",
|
|
22
|
+
"complete/newline-between-switch-case": "error",
|
|
23
|
+
"complete/no-confusing-set-methods": "error",
|
|
24
|
+
"complete/no-empty-jsdoc": "error",
|
|
25
|
+
"complete/no-empty-line-comments": "error",
|
|
26
|
+
"complete/no-explicit-array-loops": "error",
|
|
27
|
+
"complete/no-explicit-map-set-loops": "error",
|
|
28
|
+
"complete/no-for-in": "error",
|
|
29
|
+
"complete/no-let-any": "error",
|
|
30
|
+
"complete/no-mutable-return": "error",
|
|
31
|
+
"complete/no-number-enums": "error",
|
|
32
|
+
"complete/no-object-any": "error",
|
|
33
|
+
"complete/no-object-methods-with-map-set": "error",
|
|
34
|
+
"complete/no-string-length-0": "error",
|
|
35
|
+
"complete/no-template-curly-in-string-fix": "error",
|
|
36
|
+
"complete/no-undefined-return-type": "error",
|
|
37
|
+
"complete/no-unnecessary-assignment": "error",
|
|
38
|
+
"complete/no-unsafe-plusplus": "error",
|
|
39
|
+
"complete/no-useless-return": "error",
|
|
40
|
+
"complete/no-void-return-type": "error",
|
|
41
|
+
"complete/prefer-const": "error",
|
|
42
|
+
"complete/prefer-plusplus": "error",
|
|
43
|
+
"complete/prefer-postfix-plusplus": "error",
|
|
44
|
+
"complete/prefer-readonly-parameter-types": "error",
|
|
45
|
+
"complete/require-break": "error",
|
|
46
|
+
"complete/require-capital-const-assertions": "error",
|
|
47
|
+
"complete/require-capital-read-only": "error",
|
|
48
|
+
"complete/require-unannotated-const-assertions": "error",
|
|
49
|
+
"complete/require-variadic-function-argument": "error",
|
|
50
|
+
"complete/strict-array-methods": "error",
|
|
51
|
+
"complete/strict-enums": "error",
|
|
52
|
+
"complete/strict-undefined-functions": "error",
|
|
53
|
+
"complete/strict-void-functions": "error",
|
|
54
54
|
},
|
|
55
55
|
// Rules that require type information will throw an error on ".json" files. (This is needed
|
|
56
56
|
// when using `eslint-plugin-package-json`. Even though this config does not currently use the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-eslint.d.ts","sourceRoot":"","sources":["../../src/base/base-eslint.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-eslint.d.ts","sourceRoot":"","sources":["../../src/base/base-eslint.js"],"names":[],"mappings":"AA2pBA;;;;;;;;GAQG;AACH,0DAMG"}
|
package/dist/base/base-eslint.js
CHANGED
|
@@ -7,86 +7,104 @@ import { defineConfig } from "eslint/config";
|
|
|
7
7
|
const POSSIBLE_PROBLEMS = {
|
|
8
8
|
/** The `checkForEach` option is enabled to make the rule stricter. */
|
|
9
9
|
"array-callback-return": [
|
|
10
|
-
"
|
|
10
|
+
"error",
|
|
11
11
|
{
|
|
12
12
|
checkForEach: true,
|
|
13
13
|
},
|
|
14
14
|
],
|
|
15
|
+
/** Disabled since this is already enforced by TypeScript (`ts(2335)` & `ts(2377)`). */
|
|
15
16
|
"constructor-super": "off", // @typescript-eslint/eslint-recommended
|
|
16
|
-
"for-direction": "
|
|
17
|
+
"for-direction": "error",
|
|
18
|
+
/** Disabled since this is already enforced by TypeScript (`ts(2378)`). */
|
|
17
19
|
"getter-return": "off", // @typescript-eslint/eslint-recommended
|
|
18
|
-
"no-async-promise-executor": "
|
|
19
|
-
"no-await-in-loop": "
|
|
20
|
-
|
|
21
|
-
"no-
|
|
22
|
-
"no-
|
|
20
|
+
"no-async-promise-executor": "error",
|
|
21
|
+
"no-await-in-loop": "error",
|
|
22
|
+
/** Disabled since this is already enforced by TypeScript (`ts(2629)`). */
|
|
23
|
+
"no-class-assign": "error",
|
|
24
|
+
"no-compare-neg-zero": "error",
|
|
25
|
+
"no-cond-assign": "error",
|
|
26
|
+
/** Disabled since this is already enforced by TypeScript (`ts(2588)`). */
|
|
23
27
|
"no-const-assign": "off", // @typescript-eslint/eslint-recommended
|
|
24
|
-
"no-constant-binary-expression": "
|
|
25
|
-
"no-constant-condition": "
|
|
26
|
-
"no-constructor-return": "
|
|
27
|
-
"no-control-regex": "
|
|
28
|
-
"no-debugger": "
|
|
28
|
+
"no-constant-binary-expression": "error",
|
|
29
|
+
"no-constant-condition": "error",
|
|
30
|
+
"no-constructor-return": "error",
|
|
31
|
+
"no-control-regex": "error",
|
|
32
|
+
"no-debugger": "error",
|
|
33
|
+
/** Disabled since this is already enforced by TypeScript (`ts(2300)`). */
|
|
29
34
|
"no-dupe-args": "off", // @typescript-eslint/eslint-recommended
|
|
35
|
+
/** Disabled since this is already enforced by TypeScript (`ts(2393)` & `ts(2300)`). */
|
|
30
36
|
"no-dupe-class-members": "off", // @typescript-eslint/eslint-recommended
|
|
31
|
-
"no-dupe-else-if": "
|
|
37
|
+
"no-dupe-else-if": "error",
|
|
38
|
+
/** Disabled since this is already enforced by TypeScript (`ts(1117)`). */
|
|
32
39
|
"no-dupe-keys": "off", // @typescript-eslint/eslint-recommended
|
|
33
|
-
"no-duplicate-case": "
|
|
40
|
+
"no-duplicate-case": "error",
|
|
34
41
|
/** Superseded by the `import-x/no-duplicates` rule. */
|
|
35
42
|
"no-duplicate-imports": "off",
|
|
36
|
-
"no-empty-character-class": "
|
|
37
|
-
"no-empty-pattern": "
|
|
38
|
-
"no-ex-assign": "
|
|
39
|
-
"no-fallthrough": "
|
|
43
|
+
"no-empty-character-class": "error",
|
|
44
|
+
"no-empty-pattern": "error",
|
|
45
|
+
"no-ex-assign": "error",
|
|
46
|
+
"no-fallthrough": "error",
|
|
47
|
+
/** Disabled since this is already enforced by TypeScript (`ts(2630)`). */
|
|
40
48
|
"no-func-assign": "off", // @typescript-eslint/eslint-recommended
|
|
49
|
+
/** Disabled since this is already enforced by TypeScript (`ts(2632)` & `ts(2540)`). */
|
|
41
50
|
"no-import-assign": "off", // @typescript-eslint/eslint-recommended
|
|
42
|
-
"no-inner-declarations": "
|
|
43
|
-
"no-invalid-regexp": "
|
|
44
|
-
"no-irregular-whitespace": "
|
|
51
|
+
"no-inner-declarations": "error",
|
|
52
|
+
"no-invalid-regexp": "error",
|
|
53
|
+
"no-irregular-whitespace": "error",
|
|
45
54
|
/** Superseded by the `@typescript-eslint/no-loss-of-precision` rule. */
|
|
46
55
|
"no-loss-of-precision": "off",
|
|
47
|
-
"no-misleading-character-class": "
|
|
48
|
-
|
|
56
|
+
"no-misleading-character-class": "error",
|
|
57
|
+
/** Disabled since this is already enforced by TypeScript (`ts(7009)`). */
|
|
58
|
+
"no-new-native-nonconstructor": "off", // @typescript-eslint/eslint-recommended
|
|
59
|
+
/** Disabled since this is already enforced by TypeScript (`ts(2349)`). */
|
|
49
60
|
"no-obj-calls": "off", // @typescript-eslint/eslint-recommended`
|
|
50
|
-
"no-promise-executor-return": "
|
|
51
|
-
"no-prototype-builtins": "
|
|
52
|
-
"no-self-assign": "
|
|
53
|
-
"no-self-compare": "
|
|
61
|
+
"no-promise-executor-return": "error",
|
|
62
|
+
"no-prototype-builtins": "error",
|
|
63
|
+
"no-self-assign": "error",
|
|
64
|
+
"no-self-compare": "error",
|
|
65
|
+
/** Disabled since this is already enforced by TypeScript (`ts(2408)`). */
|
|
54
66
|
"no-setter-return": "off", // @typescript-eslint/eslint-recommended
|
|
55
|
-
"no-sparse-arrays": "
|
|
67
|
+
"no-sparse-arrays": "error",
|
|
56
68
|
/** Superseded by the `complete/eqeqeq-fix` rule (since we want auto-fix to work properly). */
|
|
57
69
|
"no-template-curly-in-string": "off",
|
|
70
|
+
/** Disabled since this is already enforced by TypeScript (`ts(2376)` & `ts(17009)`). */
|
|
58
71
|
"no-this-before-super": "off", // @typescript-eslint/eslint-recommended`
|
|
59
|
-
"no-unassigned-vars": "
|
|
72
|
+
"no-unassigned-vars": "error",
|
|
73
|
+
/** Disabled since this is already enforced by TypeScript (`ts(2304)` & `ts(2552)`). */
|
|
60
74
|
"no-undef": "off", // @typescript-eslint/eslint-recommended
|
|
61
75
|
"no-unexpected-multiline": "off", // eslint-config-prettier
|
|
62
|
-
"no-unmodified-loop-condition": "
|
|
76
|
+
"no-unmodified-loop-condition": "error",
|
|
77
|
+
/** Disabled since this is already enforced by TypeScript (`ts(7027)`). */
|
|
63
78
|
"no-unreachable": "off", // @typescript-eslint/eslint-recommended
|
|
64
|
-
"no-unreachable-loop": "
|
|
65
|
-
"no-unsafe-finally": "
|
|
79
|
+
"no-unreachable-loop": "error",
|
|
80
|
+
"no-unsafe-finally": "error",
|
|
81
|
+
/**
|
|
82
|
+
* Disabled since this is already enforced by TypeScript (`ts(2365)` & `ts(2322)` & `ts(2358)`).
|
|
83
|
+
*/
|
|
66
84
|
"no-unsafe-negation": "off", // @typescript-eslint/eslint-recommended
|
|
67
|
-
"no-unsafe-optional-chaining": "
|
|
68
|
-
"no-unused-private-class-members": "
|
|
85
|
+
"no-unsafe-optional-chaining": "error",
|
|
86
|
+
"no-unused-private-class-members": "error",
|
|
69
87
|
/** Superseded by the `@typescript-eslint/no-unused-vars` rule. */
|
|
70
88
|
"no-unused-vars": "off",
|
|
71
89
|
/** Superseded by the `@typescript-eslint/no-use-before-define` rule. */
|
|
72
90
|
"no-use-before-define": "off",
|
|
73
|
-
"no-useless-backreference": "
|
|
91
|
+
"no-useless-backreference": "error",
|
|
74
92
|
/**
|
|
75
93
|
* Disabled since [Airbnb reports that the rule is "very
|
|
76
94
|
* buggy"](https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/errors.js).
|
|
77
95
|
*/
|
|
78
96
|
"require-atomic-updates": "off",
|
|
79
|
-
"use-isnan": "
|
|
80
|
-
"valid-typeof": "
|
|
97
|
+
"use-isnan": "error",
|
|
98
|
+
"valid-typeof": "error",
|
|
81
99
|
};
|
|
82
100
|
/**
|
|
83
101
|
* @type {Record<string, import("@typescript-eslint/utils").TSESLint.SharedConfig.RuleEntry>}
|
|
84
102
|
* @see https://eslint.org/docs/latest/rules/#suggestions
|
|
85
103
|
*/
|
|
86
104
|
const SUGGESTIONS = {
|
|
87
|
-
"accessor-pairs": "
|
|
88
|
-
"arrow-body-style": "
|
|
89
|
-
"block-scoped-var": "
|
|
105
|
+
"accessor-pairs": "error",
|
|
106
|
+
"arrow-body-style": "error",
|
|
107
|
+
"block-scoped-var": "error",
|
|
90
108
|
/**
|
|
91
109
|
* Superseded by the `@typescript-eslint/naming-convention` rule. (`camelcase` is used to enforce
|
|
92
110
|
* naming conventions.)
|
|
@@ -106,34 +124,34 @@ const SUGGESTIONS = {
|
|
|
106
124
|
complexity: "off",
|
|
107
125
|
/** Superseded by the `@typescript-eslint/consistent-return` rule. */
|
|
108
126
|
"consistent-return": "off",
|
|
109
|
-
"consistent-this": "
|
|
127
|
+
"consistent-this": "error",
|
|
110
128
|
/**
|
|
111
129
|
* Always requiring curly braces can partially ward against [Apple-style if statement
|
|
112
130
|
* bugs](https://www.imperialviolet.org/2014/02/22/applebug.html). Additionally, this rule needs
|
|
113
131
|
* to be set to "all" to [work properly with
|
|
114
132
|
* Prettier](https://github.com/prettier/eslint-config-prettier#curly).
|
|
115
133
|
*/
|
|
116
|
-
curly: ["
|
|
134
|
+
curly: ["error", "all"],
|
|
117
135
|
/**
|
|
118
136
|
* Disabled since it would cause the `@typescript-eslint/switch-exhaustiveness-check` rule to not
|
|
119
137
|
* work properly.
|
|
120
138
|
*/
|
|
121
139
|
"default-case": "off",
|
|
122
|
-
"default-case-last": "
|
|
140
|
+
"default-case-last": "error",
|
|
123
141
|
/** Superseded by the `@typescript-eslint/default-param-last` rule. */
|
|
124
142
|
"default-param-last": "off",
|
|
125
143
|
/** Superseded by the `@typescript-eslint/dot-notation` rule. */
|
|
126
144
|
"dot-notation": "off",
|
|
127
145
|
/** Superseded by the `complete/eqeqeq-fix` rule (since we want auto-fix to work properly). */
|
|
128
146
|
eqeqeq: "off",
|
|
129
|
-
"func-name-matching": "
|
|
130
|
-
"func-names": "
|
|
147
|
+
"func-name-matching": "error",
|
|
148
|
+
"func-names": "error",
|
|
131
149
|
/**
|
|
132
150
|
* Disabled since it is common in the TypeScript ecosystem to use both function forms, depending
|
|
133
151
|
* on the situation.
|
|
134
152
|
*/
|
|
135
153
|
"func-style": "off",
|
|
136
|
-
"grouped-accessor-pairs": "
|
|
154
|
+
"grouped-accessor-pairs": "error",
|
|
137
155
|
/** Superseded by the `complete/no-for-in` rule. */
|
|
138
156
|
"guard-for-in": "off",
|
|
139
157
|
/** Disabled since it is expected to be configured with project-specific keywords. */
|
|
@@ -149,13 +167,13 @@ const SUGGESTIONS = {
|
|
|
149
167
|
"init-declarations": "off",
|
|
150
168
|
/** The `enforceForIfStatements` option is enabled to make the rule stricter. */
|
|
151
169
|
"logical-assignment-operators": [
|
|
152
|
-
"
|
|
170
|
+
"error",
|
|
153
171
|
"always",
|
|
154
172
|
{
|
|
155
173
|
enforceForIfStatements: true,
|
|
156
174
|
},
|
|
157
175
|
],
|
|
158
|
-
"max-classes-per-file": "
|
|
176
|
+
"max-classes-per-file": "error",
|
|
159
177
|
/** Disabled since this rule is too prescriptive for general-purpose use. */
|
|
160
178
|
"max-depth": "off",
|
|
161
179
|
/**
|
|
@@ -168,7 +186,7 @@ const SUGGESTIONS = {
|
|
|
168
186
|
* provide much value.
|
|
169
187
|
*/
|
|
170
188
|
"max-lines-per-function": "off",
|
|
171
|
-
"max-nested-callbacks": "
|
|
189
|
+
"max-nested-callbacks": "error",
|
|
172
190
|
/** Superseded by the `@typescript-eslint/max-params` rule. */
|
|
173
191
|
"max-params": "off",
|
|
174
192
|
/**
|
|
@@ -176,13 +194,13 @@ const SUGGESTIONS = {
|
|
|
176
194
|
* does not provide much value.
|
|
177
195
|
*/
|
|
178
196
|
"max-statements": "off",
|
|
179
|
-
"new-cap": "
|
|
180
|
-
"no-alert": "
|
|
197
|
+
"new-cap": "error",
|
|
198
|
+
"no-alert": "error",
|
|
181
199
|
/** Superseded by the `@typescript-eslint/no-array-constructor` rule. */
|
|
182
200
|
"no-array-constructor": "off",
|
|
183
|
-
"no-bitwise": "
|
|
184
|
-
"no-caller": "
|
|
185
|
-
"no-case-declarations": "
|
|
201
|
+
"no-bitwise": "error",
|
|
202
|
+
"no-caller": "error",
|
|
203
|
+
"no-case-declarations": "error",
|
|
186
204
|
/**
|
|
187
205
|
* Disabled because command-line programs written in TypeScript commonly write to standard out and
|
|
188
206
|
* standard error.
|
|
@@ -194,65 +212,65 @@ const SUGGESTIONS = {
|
|
|
194
212
|
* pattern](https://medium.com/swlh/return-early-pattern-3d18a41bba8).
|
|
195
213
|
*/
|
|
196
214
|
"no-continue": "off",
|
|
197
|
-
"no-delete-var": "
|
|
215
|
+
"no-delete-var": "error",
|
|
198
216
|
/** Disabled since it is incompatible with the `unicorn/better-regex` rule. */
|
|
199
217
|
"no-div-regex": "off",
|
|
200
218
|
/** The `allowElseIf` option is disabled to make the rule stricter. */
|
|
201
219
|
"no-else-return": [
|
|
202
|
-
"
|
|
220
|
+
"error",
|
|
203
221
|
{
|
|
204
222
|
allowElseIf: false,
|
|
205
223
|
},
|
|
206
224
|
],
|
|
207
|
-
"no-empty": "
|
|
225
|
+
"no-empty": "error",
|
|
208
226
|
/** Superseded by the `@typescript-eslint/no-empty-function` rule. */
|
|
209
227
|
"no-empty-function": "off",
|
|
210
|
-
"no-empty-static-block": "
|
|
211
|
-
"no-eq-null": "
|
|
212
|
-
"no-eval": "
|
|
213
|
-
"no-extend-native": "
|
|
214
|
-
"no-extra-bind": "
|
|
215
|
-
"no-extra-boolean-cast": "
|
|
216
|
-
"no-extra-label": "
|
|
217
|
-
"no-global-assign": "
|
|
218
|
-
"no-implicit-coercion": "
|
|
219
|
-
"no-implicit-globals": "
|
|
228
|
+
"no-empty-static-block": "error",
|
|
229
|
+
"no-eq-null": "error",
|
|
230
|
+
"no-eval": "error",
|
|
231
|
+
"no-extend-native": "error",
|
|
232
|
+
"no-extra-bind": "error",
|
|
233
|
+
"no-extra-boolean-cast": "error",
|
|
234
|
+
"no-extra-label": "error",
|
|
235
|
+
"no-global-assign": "error",
|
|
236
|
+
"no-implicit-coercion": "error",
|
|
237
|
+
"no-implicit-globals": "error",
|
|
220
238
|
/** Superseded by the `@typescript-eslint/no-implied-eval` rule. */
|
|
221
239
|
"no-implied-eval": "off",
|
|
222
240
|
/** Disabled because inline comments are common in the TypeScript ecosystem. */
|
|
223
241
|
"no-inline-comments": "off",
|
|
224
242
|
/** Superseded by the `@typescript-eslint/no-invalid-this` rule. */
|
|
225
243
|
"no-invalid-this": "off",
|
|
226
|
-
"no-iterator": "
|
|
227
|
-
"no-label-var": "
|
|
228
|
-
"no-labels": "
|
|
229
|
-
"no-lone-blocks": "
|
|
230
|
-
"no-lonely-if": "
|
|
244
|
+
"no-iterator": "error",
|
|
245
|
+
"no-label-var": "error",
|
|
246
|
+
"no-labels": "error",
|
|
247
|
+
"no-lone-blocks": "error",
|
|
248
|
+
"no-lonely-if": "error",
|
|
231
249
|
/** Superseded by the `@typescript-eslint/no-loop-func` rule. */
|
|
232
250
|
"no-loop-func": "off",
|
|
233
251
|
/** Superseded by the `@typescript-eslint/no-magic-numbers` rule. */
|
|
234
252
|
"no-magic-numbers": "off",
|
|
235
|
-
"no-multi-assign": "
|
|
236
|
-
"no-multi-str": "
|
|
253
|
+
"no-multi-assign": "error",
|
|
254
|
+
"no-multi-str": "error",
|
|
237
255
|
/** Superseded by the `unicorn/no-negated-condition` rule. */
|
|
238
256
|
"no-negated-condition": "off",
|
|
239
257
|
/**
|
|
240
258
|
* `unicorn/no-nested-ternary` is a modified version of this rule but that version is less strict.
|
|
241
259
|
*/
|
|
242
|
-
"no-nested-ternary": "
|
|
243
|
-
"no-new": "
|
|
244
|
-
"no-new-func": "
|
|
245
|
-
"no-new-wrappers": "
|
|
246
|
-
"no-nonoctal-decimal-escape": "
|
|
247
|
-
"no-object-constructor": "
|
|
248
|
-
"no-octal": "
|
|
249
|
-
"no-octal-escape": "
|
|
260
|
+
"no-nested-ternary": "error",
|
|
261
|
+
"no-new": "error",
|
|
262
|
+
"no-new-func": "error",
|
|
263
|
+
"no-new-wrappers": "error",
|
|
264
|
+
"no-nonoctal-decimal-escape": "error",
|
|
265
|
+
"no-object-constructor": "error",
|
|
266
|
+
"no-octal": "error",
|
|
267
|
+
"no-octal-escape": "error",
|
|
250
268
|
/**
|
|
251
269
|
* The options are [copied from
|
|
252
270
|
* Airbnb](https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/best-practices.js).
|
|
253
271
|
*/
|
|
254
272
|
"no-param-reassign": [
|
|
255
|
-
"
|
|
273
|
+
"error",
|
|
256
274
|
{
|
|
257
275
|
props: true,
|
|
258
276
|
ignorePropertyModificationsFor: [
|
|
@@ -275,16 +293,16 @@ const SUGGESTIONS = {
|
|
|
275
293
|
* errors with minified code, but Prettier adds semicolons automatically.)
|
|
276
294
|
*/
|
|
277
295
|
"no-plusplus": "off",
|
|
278
|
-
"no-proto": "
|
|
279
|
-
/**
|
|
280
|
-
"no-redeclare": "off",
|
|
281
|
-
"no-regex-spaces": "
|
|
296
|
+
"no-proto": "error",
|
|
297
|
+
/** Disabled since this is already enforced by TypeScript (`ts(2451)`). */
|
|
298
|
+
"no-redeclare": "off", // @typescript-eslint/eslint-recommended
|
|
299
|
+
"no-regex-spaces": "error",
|
|
282
300
|
/**
|
|
283
301
|
* The options are [copied from
|
|
284
302
|
* Airbnb](https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/es6.js).
|
|
285
303
|
*/
|
|
286
304
|
"no-restricted-exports": [
|
|
287
|
-
"
|
|
305
|
+
"error",
|
|
288
306
|
{
|
|
289
307
|
restrictedNamedExports: [
|
|
290
308
|
"default", // use `export default` to provide a default export
|
|
@@ -297,7 +315,7 @@ const SUGGESTIONS = {
|
|
|
297
315
|
* Airbnb](https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/variables.js).
|
|
298
316
|
*/
|
|
299
317
|
"no-restricted-globals": [
|
|
300
|
-
"
|
|
318
|
+
"error",
|
|
301
319
|
{
|
|
302
320
|
name: "isFinite",
|
|
303
321
|
message: "Use Number.isFinite instead: https://github.com/airbnb/javascript#standard-library--isfinite",
|
|
@@ -315,7 +333,7 @@ const SUGGESTIONS = {
|
|
|
315
333
|
* Airbnb](https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/best-practices.js).
|
|
316
334
|
*/
|
|
317
335
|
"no-restricted-properties": [
|
|
318
|
-
"
|
|
336
|
+
"error",
|
|
319
337
|
{
|
|
320
338
|
object: "arguments",
|
|
321
339
|
property: "callee",
|
|
@@ -368,8 +386,8 @@ const SUGGESTIONS = {
|
|
|
368
386
|
/** Disabled because it is intended for disallowing specific language features per-project. */
|
|
369
387
|
"no-restricted-syntax": "off",
|
|
370
388
|
/** The `always` option is provided to make the rule stricter. */
|
|
371
|
-
"no-return-assign": ["
|
|
372
|
-
"no-script-url": "
|
|
389
|
+
"no-return-assign": ["error", "always"],
|
|
390
|
+
"no-script-url": "error",
|
|
373
391
|
/**
|
|
374
392
|
* Disabled because [it can conflict with
|
|
375
393
|
* Prettier](https://github.com/prettier/eslint-config-prettier/tree/main#no-sequences).
|
|
@@ -377,7 +395,7 @@ const SUGGESTIONS = {
|
|
|
377
395
|
"no-sequences": "off",
|
|
378
396
|
/** Superseded by the `@typescript-eslint/no-shadow` rule. */
|
|
379
397
|
"no-shadow": "off",
|
|
380
|
-
"no-shadow-restricted-names": "
|
|
398
|
+
"no-shadow-restricted-names": "error",
|
|
381
399
|
/**
|
|
382
400
|
* Disabled because ternaries are common in the TypeScript ecosystem and can often lead to concise
|
|
383
401
|
* code that is easy to read.
|
|
@@ -385,7 +403,7 @@ const SUGGESTIONS = {
|
|
|
385
403
|
"no-ternary": "off",
|
|
386
404
|
/** Superseded by the `@typescript-eslint/no-throw-literal` rule. */
|
|
387
405
|
"no-throw-literal": "off",
|
|
388
|
-
"no-undef-init": "
|
|
406
|
+
"no-undef-init": "error",
|
|
389
407
|
/**
|
|
390
408
|
* Disabled because in TypeScript, it is common to explicitly check for undefined for the purposes
|
|
391
409
|
* of type narrowing.
|
|
@@ -398,41 +416,42 @@ const SUGGESTIONS = {
|
|
|
398
416
|
"no-underscore-dangle": "off",
|
|
399
417
|
/** The `defaultAssignment` option is disabled to make the rule stricter. */
|
|
400
418
|
"no-unneeded-ternary": [
|
|
401
|
-
"
|
|
419
|
+
"error",
|
|
402
420
|
{
|
|
403
421
|
defaultAssignment: false,
|
|
404
422
|
},
|
|
405
423
|
],
|
|
406
424
|
/** Superseded by the `@typescript-eslint/no-unused-expressions` rule. */
|
|
407
425
|
"no-unused-expressions": "off",
|
|
408
|
-
"no-unused-labels": "
|
|
409
|
-
"no-useless-assignment": "
|
|
410
|
-
"no-useless-call": "
|
|
411
|
-
"no-useless-catch": "
|
|
426
|
+
"no-unused-labels": "error",
|
|
427
|
+
"no-useless-assignment": "error",
|
|
428
|
+
"no-useless-call": "error",
|
|
429
|
+
"no-useless-catch": "error",
|
|
412
430
|
/** The `enforceForClassMembers` option is enabled to make the rule stricter. */
|
|
413
431
|
"no-useless-computed-key": [
|
|
414
|
-
"
|
|
432
|
+
"error",
|
|
415
433
|
{
|
|
416
434
|
enforceForClassMembers: true,
|
|
417
435
|
},
|
|
418
436
|
],
|
|
419
|
-
"no-useless-concat": "
|
|
437
|
+
"no-useless-concat": "error",
|
|
420
438
|
/** Superseded by the `@typescript-eslint/no-useless-constructor` rule. */
|
|
421
439
|
"no-useless-constructor": "off",
|
|
422
|
-
"no-useless-escape": "
|
|
423
|
-
"no-useless-rename": "
|
|
440
|
+
"no-useless-escape": "error",
|
|
441
|
+
"no-useless-rename": "error",
|
|
424
442
|
/**
|
|
425
443
|
* Superseded by the `complete/no-useless-return` rule (since the auto-fix is usually unwanted).
|
|
426
444
|
*/
|
|
427
445
|
"no-useless-return": "off",
|
|
428
|
-
"no-var": "
|
|
429
|
-
"no-void": "
|
|
446
|
+
"no-var": "error",
|
|
447
|
+
"no-void": "error",
|
|
430
448
|
/** Superseded by the `unicorn/expiring-todo-comments` rule. */
|
|
431
449
|
"no-warning-comments": "off",
|
|
432
|
-
|
|
450
|
+
/** Disabled since this is already enforced by TypeScript (`ts(1101)` & `ts(2410)`). */
|
|
451
|
+
"no-with": "off", // @typescript-eslint/eslint-recommended
|
|
433
452
|
/** The `ignoreConstructors` option is disabled to make the rule stricter. */
|
|
434
453
|
"object-shorthand": [
|
|
435
|
-
"
|
|
454
|
+
"error",
|
|
436
455
|
"always",
|
|
437
456
|
{
|
|
438
457
|
ignoreConstructors: false,
|
|
@@ -442,36 +461,36 @@ const SUGGESTIONS = {
|
|
|
442
461
|
* The `never` option is provided to disallow multi-variable declarations (since they can be
|
|
443
462
|
* confusing).
|
|
444
463
|
*/
|
|
445
|
-
"one-var": ["
|
|
446
|
-
"operator-assignment": "
|
|
447
|
-
"prefer-arrow-callback": "
|
|
464
|
+
"one-var": ["error", "never"],
|
|
465
|
+
"operator-assignment": "error",
|
|
466
|
+
"prefer-arrow-callback": "error",
|
|
448
467
|
/** Superseded by the `complete/prefer-const` rule (since the auto-fix is usually unwanted). */
|
|
449
468
|
"prefer-const": "off",
|
|
450
469
|
/** Superseded by the `@typescript-eslint/prefer-destructuring` rule. */
|
|
451
470
|
"prefer-destructuring": "off",
|
|
452
|
-
"prefer-exponentiation-operator": "
|
|
471
|
+
"prefer-exponentiation-operator": "error",
|
|
453
472
|
/**
|
|
454
473
|
* Disabled because it is common to have a regex with only a single match, in which case a named
|
|
455
474
|
* capture group can be needlessly verbose (and cause extra type narrowing).
|
|
456
475
|
*/
|
|
457
476
|
"prefer-named-capture-group": "off",
|
|
458
|
-
"prefer-numeric-literals": "
|
|
459
|
-
"prefer-object-has-own": "
|
|
460
|
-
"prefer-object-spread": "
|
|
477
|
+
"prefer-numeric-literals": "error",
|
|
478
|
+
"prefer-object-has-own": "error",
|
|
479
|
+
"prefer-object-spread": "error",
|
|
461
480
|
/** Superseded by the `@typescript-eslint/prefer-promise-reject-errors` rule. */
|
|
462
481
|
"prefer-promise-reject-errors": "off",
|
|
463
482
|
/** The `disallowRedundantWrapping` option is enabled to make the rule stricter. */
|
|
464
483
|
"prefer-regex-literals": [
|
|
465
|
-
"
|
|
484
|
+
"error",
|
|
466
485
|
{
|
|
467
486
|
disallowRedundantWrapping: true,
|
|
468
487
|
},
|
|
469
488
|
],
|
|
470
|
-
"prefer-rest-params": "
|
|
471
|
-
"prefer-spread": "
|
|
472
|
-
"prefer-template": "
|
|
473
|
-
"preserve-caught-error": "
|
|
474
|
-
radix: "
|
|
489
|
+
"prefer-rest-params": "error",
|
|
490
|
+
"prefer-spread": "error",
|
|
491
|
+
"prefer-template": "error",
|
|
492
|
+
"preserve-caught-error": "error",
|
|
493
|
+
radix: "error",
|
|
475
494
|
/** Superseded by the `@typescript-eslint/require-await` rule. */
|
|
476
495
|
"require-await": "off",
|
|
477
496
|
/**
|
|
@@ -480,7 +499,7 @@ const SUGGESTIONS = {
|
|
|
480
499
|
* the verbosity.)
|
|
481
500
|
*/
|
|
482
501
|
"require-unicode-regexp": "off",
|
|
483
|
-
"require-yield": "
|
|
502
|
+
"require-yield": "error",
|
|
484
503
|
/** Disabled since this is automatically handled by `prettier-plugin-organize-imports`. */
|
|
485
504
|
"sort-imports": "off",
|
|
486
505
|
/** Disabled because object keys are often not meant to be sorted in alphabetical order. */
|
|
@@ -490,17 +509,17 @@ const SUGGESTIONS = {
|
|
|
490
509
|
*/
|
|
491
510
|
"sort-vars": "off",
|
|
492
511
|
/** The `never` option is provided to make the rule stricter. */
|
|
493
|
-
strict: ["
|
|
494
|
-
"symbol-description": "
|
|
495
|
-
"vars-on-top": "
|
|
496
|
-
yoda: "
|
|
512
|
+
strict: ["error", "never"],
|
|
513
|
+
"symbol-description": "error",
|
|
514
|
+
"vars-on-top": "error",
|
|
515
|
+
yoda: "error",
|
|
497
516
|
};
|
|
498
517
|
/**
|
|
499
518
|
* @type {Record<string, import("@typescript-eslint/utils").TSESLint.SharedConfig.RuleEntry>}
|
|
500
519
|
* @see https://eslint.org/docs/latest/rules/#suggestions
|
|
501
520
|
*/
|
|
502
521
|
const LAYOUT_AND_FORMATTING = {
|
|
503
|
-
"unicode-bom": "
|
|
522
|
+
"unicode-bom": "error",
|
|
504
523
|
};
|
|
505
524
|
/**
|
|
506
525
|
* This ESLint config only contains built-in rules from ESLint itself:
|