eslint-config-complete 3.2.4 → 4.0.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.js +124 -124
- package/dist/base/base-import-x.js +24 -24
- package/dist/base/base-jsdoc.js +31 -31
- package/dist/base/base-n.js +9 -9
- package/dist/base/base-stylistic.js +3 -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 +1 -1
|
@@ -35,24 +35,24 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
rules: {
|
|
38
|
-
"@typescript-eslint/adjacent-overload-signatures": "
|
|
38
|
+
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
39
39
|
/**
|
|
40
40
|
* The default value is `array`. We choose `array-simple` because it makes complicated arrays
|
|
41
41
|
* easier to understand. This is worth the cost of deviating from the base rule configuration.
|
|
42
42
|
*/
|
|
43
43
|
"@typescript-eslint/array-type": [
|
|
44
|
-
"
|
|
44
|
+
"error",
|
|
45
45
|
{
|
|
46
46
|
default: "array-simple",
|
|
47
47
|
},
|
|
48
48
|
],
|
|
49
|
-
"@typescript-eslint/await-thenable": "
|
|
50
|
-
"@typescript-eslint/ban-ts-comment": "
|
|
51
|
-
"@typescript-eslint/ban-tslint-comment": "
|
|
52
|
-
"@typescript-eslint/class-literal-property-style": "
|
|
53
|
-
"@typescript-eslint/class-methods-use-this": "
|
|
54
|
-
"@typescript-eslint/consistent-generic-constructors": "
|
|
55
|
-
"@typescript-eslint/consistent-indexed-object-style": "
|
|
49
|
+
"@typescript-eslint/await-thenable": "error",
|
|
50
|
+
"@typescript-eslint/ban-ts-comment": "error",
|
|
51
|
+
"@typescript-eslint/ban-tslint-comment": "error",
|
|
52
|
+
"@typescript-eslint/class-literal-property-style": "error",
|
|
53
|
+
"@typescript-eslint/class-methods-use-this": "error",
|
|
54
|
+
"@typescript-eslint/consistent-generic-constructors": "error",
|
|
55
|
+
"@typescript-eslint/consistent-indexed-object-style": "error",
|
|
56
56
|
/**
|
|
57
57
|
* Disabled since this is handled by the `noImplicitReturns` TypeScript compiler flag. (The
|
|
58
58
|
* compiler flag does not technically handle all cases that the rule does. However, in most
|
|
@@ -61,12 +61,12 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
61
61
|
* `complete/strict-void-functions` rule.)
|
|
62
62
|
*/
|
|
63
63
|
"@typescript-eslint/consistent-return": "off",
|
|
64
|
-
"@typescript-eslint/consistent-type-assertions": "
|
|
65
|
-
"@typescript-eslint/consistent-type-definitions": "
|
|
66
|
-
"@typescript-eslint/consistent-type-exports": "
|
|
67
|
-
"@typescript-eslint/consistent-type-imports": "
|
|
68
|
-
"@typescript-eslint/default-param-last": "
|
|
69
|
-
"@typescript-eslint/dot-notation": "
|
|
64
|
+
"@typescript-eslint/consistent-type-assertions": "error",
|
|
65
|
+
"@typescript-eslint/consistent-type-definitions": "error",
|
|
66
|
+
"@typescript-eslint/consistent-type-exports": "error",
|
|
67
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
68
|
+
"@typescript-eslint/default-param-last": "error",
|
|
69
|
+
"@typescript-eslint/dot-notation": "error",
|
|
70
70
|
/**
|
|
71
71
|
* Disabled since it would be to cumbersome to require return types for non-exported
|
|
72
72
|
* functions. (It is more reasonable to require it for exported functions only, since it
|
|
@@ -78,7 +78,7 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
78
78
|
* explicit public/private distinction.
|
|
79
79
|
*/
|
|
80
80
|
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
81
|
-
"@typescript-eslint/explicit-module-boundary-types": "
|
|
81
|
+
"@typescript-eslint/explicit-module-boundary-types": "error",
|
|
82
82
|
/**
|
|
83
83
|
* Disabled since it is superfluous to require an `= undefined` during variable initialization
|
|
84
84
|
* (and TypeScript will take care of the non-undefined cases).
|
|
@@ -92,7 +92,7 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
92
92
|
"@typescript-eslint/max-params": "off",
|
|
93
93
|
/** Disabled since prescribed class ordering is too project-specific. */
|
|
94
94
|
"@typescript-eslint/member-ordering": "off",
|
|
95
|
-
"@typescript-eslint/method-signature-style": "
|
|
95
|
+
"@typescript-eslint/method-signature-style": "error",
|
|
96
96
|
/**
|
|
97
97
|
* The options are [copied from
|
|
98
98
|
* Airbnb](https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/lib/shared.js).
|
|
@@ -100,7 +100,7 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
100
100
|
* being used.
|
|
101
101
|
*/
|
|
102
102
|
"@typescript-eslint/naming-convention": [
|
|
103
|
-
"
|
|
103
|
+
"error",
|
|
104
104
|
// Allow camelCase variables (23.2), PascalCase variables (23.8), and UPPER_CASE variables
|
|
105
105
|
// (23.10).
|
|
106
106
|
{
|
|
@@ -123,21 +123,21 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
123
123
|
leadingUnderscore: "allow",
|
|
124
124
|
},
|
|
125
125
|
],
|
|
126
|
-
"@typescript-eslint/no-array-constructor": "
|
|
127
|
-
"@typescript-eslint/no-array-delete": "
|
|
128
|
-
"@typescript-eslint/no-base-to-string": "
|
|
129
|
-
"@typescript-eslint/no-confusing-non-null-assertion": "
|
|
130
|
-
"@typescript-eslint/no-confusing-void-expression": "
|
|
131
|
-
"@typescript-eslint/no-deprecated": "
|
|
126
|
+
"@typescript-eslint/no-array-constructor": "error",
|
|
127
|
+
"@typescript-eslint/no-array-delete": "error",
|
|
128
|
+
"@typescript-eslint/no-base-to-string": "error",
|
|
129
|
+
"@typescript-eslint/no-confusing-non-null-assertion": "error",
|
|
130
|
+
"@typescript-eslint/no-confusing-void-expression": "error",
|
|
131
|
+
"@typescript-eslint/no-deprecated": "error",
|
|
132
132
|
/**
|
|
133
133
|
* Disabled since it is superfluous when using TypeScript according to [the ESLint
|
|
134
134
|
* documentation](https://eslint.org/docs/latest/rules/no-dupe-class-members#when-not-to-use-it).
|
|
135
135
|
*/
|
|
136
136
|
"@typescript-eslint/no-dupe-class-members": "off",
|
|
137
|
-
"@typescript-eslint/no-duplicate-enum-values": "
|
|
138
|
-
"@typescript-eslint/no-duplicate-type-constituents": "
|
|
139
|
-
"@typescript-eslint/no-dynamic-delete": "
|
|
140
|
-
"@typescript-eslint/no-empty-function": "
|
|
137
|
+
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
138
|
+
"@typescript-eslint/no-duplicate-type-constituents": "error",
|
|
139
|
+
"@typescript-eslint/no-dynamic-delete": "error",
|
|
140
|
+
"@typescript-eslint/no-empty-function": "error",
|
|
141
141
|
/**
|
|
142
142
|
* The `allowSingleExtends` option is enabled to allow for the common pattern of using using
|
|
143
143
|
* interfaces to provide an opaque type. (This can be useful with type-builders such as Zod,
|
|
@@ -145,58 +145,58 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
145
145
|
* verbose/confusing mouseover tooltips and TypeScript errors.)
|
|
146
146
|
*/
|
|
147
147
|
"@typescript-eslint/no-empty-interface": [
|
|
148
|
-
"
|
|
148
|
+
"error",
|
|
149
149
|
{
|
|
150
150
|
allowSingleExtends: true,
|
|
151
151
|
},
|
|
152
152
|
],
|
|
153
|
-
"@typescript-eslint/no-empty-object-type": "
|
|
154
|
-
"@typescript-eslint/no-explicit-any": "
|
|
155
|
-
"@typescript-eslint/no-extra-non-null-assertion": "
|
|
156
|
-
"@typescript-eslint/no-extraneous-class": "
|
|
153
|
+
"@typescript-eslint/no-empty-object-type": "error",
|
|
154
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
155
|
+
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
156
|
+
"@typescript-eslint/no-extraneous-class": "error",
|
|
157
157
|
/**
|
|
158
158
|
* - The `ignoreVoid` option is disabled to make the rule stricter.
|
|
159
159
|
* - The rule is disabled in "*.test.ts" files because the built-in Node test runner returns a
|
|
160
160
|
* promise that is not meant to be awaited.
|
|
161
161
|
*/
|
|
162
162
|
"@typescript-eslint/no-floating-promises": [
|
|
163
|
-
"
|
|
163
|
+
"error",
|
|
164
164
|
{
|
|
165
165
|
ignoreVoid: false,
|
|
166
166
|
},
|
|
167
167
|
],
|
|
168
|
-
"@typescript-eslint/no-for-in-array": "
|
|
169
|
-
"@typescript-eslint/no-implied-eval": "
|
|
170
|
-
"@typescript-eslint/no-import-type-side-effects": "
|
|
171
|
-
"@typescript-eslint/no-inferrable-types": "
|
|
168
|
+
"@typescript-eslint/no-for-in-array": "error",
|
|
169
|
+
"@typescript-eslint/no-implied-eval": "error",
|
|
170
|
+
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
171
|
+
"@typescript-eslint/no-inferrable-types": "error",
|
|
172
172
|
/** The `capIsConstructor` option is disabled to make the rule stricter. */
|
|
173
173
|
"@typescript-eslint/no-invalid-this": [
|
|
174
|
-
"
|
|
174
|
+
"error",
|
|
175
175
|
{
|
|
176
176
|
capIsConstructor: false,
|
|
177
177
|
},
|
|
178
178
|
],
|
|
179
|
-
"@typescript-eslint/no-invalid-void-type": "
|
|
180
|
-
"@typescript-eslint/no-loop-func": "
|
|
181
|
-
"@typescript-eslint/no-loss-of-precision": "
|
|
179
|
+
"@typescript-eslint/no-invalid-void-type": "error",
|
|
180
|
+
"@typescript-eslint/no-loop-func": "error",
|
|
181
|
+
"@typescript-eslint/no-loss-of-precision": "error",
|
|
182
182
|
/** Disabled since it results in too many false positives. */
|
|
183
183
|
"@typescript-eslint/no-magic-numbers": "off",
|
|
184
|
-
"@typescript-eslint/no-meaningless-void-operator": "
|
|
185
|
-
"@typescript-eslint/no-misused-new": "
|
|
186
|
-
"@typescript-eslint/no-misused-promises": "
|
|
187
|
-
"@typescript-eslint/no-misused-spread": "
|
|
188
|
-
"@typescript-eslint/no-mixed-enums": "
|
|
189
|
-
"@typescript-eslint/no-namespace": "
|
|
190
|
-
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "
|
|
191
|
-
"@typescript-eslint/no-non-null-asserted-optional-chain": "
|
|
192
|
-
"@typescript-eslint/no-non-null-assertion": "
|
|
184
|
+
"@typescript-eslint/no-meaningless-void-operator": "error",
|
|
185
|
+
"@typescript-eslint/no-misused-new": "error",
|
|
186
|
+
"@typescript-eslint/no-misused-promises": "error",
|
|
187
|
+
"@typescript-eslint/no-misused-spread": "error",
|
|
188
|
+
"@typescript-eslint/no-mixed-enums": "error",
|
|
189
|
+
"@typescript-eslint/no-namespace": "error",
|
|
190
|
+
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
|
191
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
|
192
|
+
"@typescript-eslint/no-non-null-assertion": "error",
|
|
193
193
|
/**
|
|
194
194
|
* Disabled since it is handled by the combination of the TypeScript compiler and the `no-var`
|
|
195
195
|
* ESLint rule.
|
|
196
196
|
*/
|
|
197
197
|
"@typescript-eslint/no-redeclare": "off",
|
|
198
|
-
"@typescript-eslint/no-redundant-type-constituents": "
|
|
199
|
-
"@typescript-eslint/no-require-imports": "
|
|
198
|
+
"@typescript-eslint/no-redundant-type-constituents": "error",
|
|
199
|
+
"@typescript-eslint/no-require-imports": "error",
|
|
200
200
|
/**
|
|
201
201
|
* Configured to prevent importing with some common patterns that are almost always a mistake:
|
|
202
202
|
*
|
|
@@ -206,7 +206,7 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
206
206
|
* public API)
|
|
207
207
|
*/
|
|
208
208
|
"@typescript-eslint/no-restricted-imports": [
|
|
209
|
-
"
|
|
209
|
+
"error",
|
|
210
210
|
{
|
|
211
211
|
patterns: [
|
|
212
212
|
// Some "src" directories have an "index.ts" file, which means that importing from the
|
|
@@ -242,52 +242,52 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
242
242
|
],
|
|
243
243
|
/** Disabled since this rule is intended to be used for project-specific types. */
|
|
244
244
|
"@typescript-eslint/no-restricted-types": "off",
|
|
245
|
-
"@typescript-eslint/no-shadow": "
|
|
246
|
-
"@typescript-eslint/no-this-alias": "
|
|
245
|
+
"@typescript-eslint/no-shadow": "error",
|
|
246
|
+
"@typescript-eslint/no-this-alias": "error",
|
|
247
247
|
/** Disabled because this rule is deprecated. */
|
|
248
248
|
"@typescript-eslint/no-type-alias": "off",
|
|
249
|
-
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "
|
|
250
|
-
"@typescript-eslint/no-unnecessary-condition": "
|
|
251
|
-
"@typescript-eslint/no-unnecessary-parameter-property-assignment": "
|
|
252
|
-
"@typescript-eslint/no-unnecessary-qualifier": "
|
|
253
|
-
"@typescript-eslint/no-unnecessary-template-expression": "
|
|
254
|
-
"@typescript-eslint/no-unnecessary-type-arguments": "
|
|
255
|
-
"@typescript-eslint/no-unnecessary-type-assertion": "
|
|
256
|
-
"@typescript-eslint/no-unnecessary-type-constraint": "
|
|
257
|
-
"@typescript-eslint/no-unnecessary-type-conversion": "
|
|
258
|
-
"@typescript-eslint/no-unnecessary-type-parameters": "
|
|
259
|
-
"@typescript-eslint/no-unsafe-argument": "
|
|
260
|
-
"@typescript-eslint/no-unsafe-assignment": "
|
|
261
|
-
"@typescript-eslint/no-unsafe-call": "
|
|
262
|
-
"@typescript-eslint/no-unsafe-declaration-merging": "
|
|
263
|
-
"@typescript-eslint/no-unsafe-enum-comparison": "
|
|
264
|
-
"@typescript-eslint/no-unsafe-function-type": "
|
|
265
|
-
"@typescript-eslint/no-unsafe-member-access": "
|
|
266
|
-
"@typescript-eslint/no-unsafe-return": "
|
|
249
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
|
|
250
|
+
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
251
|
+
"@typescript-eslint/no-unnecessary-parameter-property-assignment": "error",
|
|
252
|
+
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
253
|
+
"@typescript-eslint/no-unnecessary-template-expression": "error",
|
|
254
|
+
"@typescript-eslint/no-unnecessary-type-arguments": "error",
|
|
255
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
256
|
+
"@typescript-eslint/no-unnecessary-type-constraint": "error",
|
|
257
|
+
"@typescript-eslint/no-unnecessary-type-conversion": "error",
|
|
258
|
+
"@typescript-eslint/no-unnecessary-type-parameters": "error",
|
|
259
|
+
"@typescript-eslint/no-unsafe-argument": "error",
|
|
260
|
+
"@typescript-eslint/no-unsafe-assignment": "error",
|
|
261
|
+
"@typescript-eslint/no-unsafe-call": "error",
|
|
262
|
+
"@typescript-eslint/no-unsafe-declaration-merging": "error",
|
|
263
|
+
"@typescript-eslint/no-unsafe-enum-comparison": "error",
|
|
264
|
+
"@typescript-eslint/no-unsafe-function-type": "error",
|
|
265
|
+
"@typescript-eslint/no-unsafe-member-access": "error",
|
|
266
|
+
"@typescript-eslint/no-unsafe-return": "error",
|
|
267
267
|
/**
|
|
268
268
|
* Disabled because this rule causes too many false positives. The rule prevents a narrowing
|
|
269
269
|
* type assertion, but often times this is precisely the point of the assertion.
|
|
270
270
|
*/
|
|
271
271
|
"@typescript-eslint/no-unsafe-type-assertion": "off",
|
|
272
|
-
"@typescript-eslint/no-unsafe-unary-minus": "
|
|
272
|
+
"@typescript-eslint/no-unsafe-unary-minus": "error",
|
|
273
273
|
/**
|
|
274
274
|
* The `allowTaggedTemplates` option is enabled to allow the rule to work with libraries like
|
|
275
275
|
* `execa`.
|
|
276
276
|
*/
|
|
277
277
|
"@typescript-eslint/no-unused-expressions": [
|
|
278
|
-
"
|
|
278
|
+
"error",
|
|
279
279
|
{
|
|
280
280
|
allowTaggedTemplates: true,
|
|
281
281
|
},
|
|
282
282
|
],
|
|
283
|
-
"@typescript-eslint/no-unused-private-class-members": "
|
|
283
|
+
"@typescript-eslint/no-unused-private-class-members": "error",
|
|
284
284
|
/**
|
|
285
285
|
* The `args` option is set to `all` make the rule stricter. Additionally, we ignore things
|
|
286
286
|
* that begin with an underscore, since this matches the behavior of the `--noUnusedLocals`
|
|
287
287
|
* TypeScript compiler flag.
|
|
288
288
|
*/
|
|
289
289
|
"@typescript-eslint/no-unused-vars": [
|
|
290
|
-
"
|
|
290
|
+
"error",
|
|
291
291
|
{
|
|
292
292
|
args: "all", // "after-used" is the default.
|
|
293
293
|
argsIgnorePattern: "^_",
|
|
@@ -296,20 +296,20 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
296
296
|
],
|
|
297
297
|
/** Disabled because it can prevent code from being structured sequentially. */
|
|
298
298
|
"@typescript-eslint/no-use-before-define": "off",
|
|
299
|
-
"@typescript-eslint/no-useless-constructor": "
|
|
300
|
-
"@typescript-eslint/no-useless-empty-export": "
|
|
301
|
-
"@typescript-eslint/no-var-requires": "
|
|
302
|
-
"@typescript-eslint/no-wrapper-object-types": "
|
|
303
|
-
"@typescript-eslint/non-nullable-type-assertion-style": "
|
|
304
|
-
"@typescript-eslint/only-throw-error": "
|
|
305
|
-
"@typescript-eslint/parameter-properties": "
|
|
306
|
-
"@typescript-eslint/prefer-as-const": "
|
|
299
|
+
"@typescript-eslint/no-useless-constructor": "error",
|
|
300
|
+
"@typescript-eslint/no-useless-empty-export": "error",
|
|
301
|
+
"@typescript-eslint/no-var-requires": "error",
|
|
302
|
+
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
303
|
+
"@typescript-eslint/non-nullable-type-assertion-style": "error",
|
|
304
|
+
"@typescript-eslint/only-throw-error": "error",
|
|
305
|
+
"@typescript-eslint/parameter-properties": "error",
|
|
306
|
+
"@typescript-eslint/prefer-as-const": "error",
|
|
307
307
|
/**
|
|
308
308
|
* Object destructuring is enforced but array destructuring is not. This matches usage in the
|
|
309
309
|
* general TypeScript ecosystem.
|
|
310
310
|
*/
|
|
311
311
|
"@typescript-eslint/prefer-destructuring": [
|
|
312
|
-
"
|
|
312
|
+
"error",
|
|
313
313
|
{
|
|
314
314
|
VariableDeclarator: {
|
|
315
315
|
array: false,
|
|
@@ -326,14 +326,14 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
326
326
|
enforceForRenamedProperties: false,
|
|
327
327
|
},
|
|
328
328
|
],
|
|
329
|
-
"@typescript-eslint/prefer-enum-initializers": "
|
|
330
|
-
"@typescript-eslint/prefer-find": "
|
|
331
|
-
"@typescript-eslint/prefer-for-of": "
|
|
332
|
-
"@typescript-eslint/prefer-function-type": "
|
|
333
|
-
"@typescript-eslint/prefer-includes": "
|
|
334
|
-
"@typescript-eslint/prefer-literal-enum-member": "
|
|
335
|
-
"@typescript-eslint/prefer-namespace-keyword": "
|
|
336
|
-
"@typescript-eslint/prefer-nullish-coalescing": "
|
|
329
|
+
"@typescript-eslint/prefer-enum-initializers": "error",
|
|
330
|
+
"@typescript-eslint/prefer-find": "error",
|
|
331
|
+
"@typescript-eslint/prefer-for-of": "error",
|
|
332
|
+
"@typescript-eslint/prefer-function-type": "error",
|
|
333
|
+
"@typescript-eslint/prefer-includes": "error",
|
|
334
|
+
"@typescript-eslint/prefer-literal-enum-member": "error",
|
|
335
|
+
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
336
|
+
"@typescript-eslint/prefer-nullish-coalescing": "error",
|
|
337
337
|
/**
|
|
338
338
|
* Disabled because it can modify the type of `boolean` declarations, which is [undesired in
|
|
339
339
|
* some
|
|
@@ -342,27 +342,27 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
342
342
|
"@typescript-eslint/prefer-optional-chain": "off",
|
|
343
343
|
/** The `allowEmptyReject` option is enabled since this is a common pattern. */
|
|
344
344
|
"@typescript-eslint/prefer-promise-reject-errors": [
|
|
345
|
-
"
|
|
345
|
+
"error",
|
|
346
346
|
{
|
|
347
347
|
allowEmptyReject: true,
|
|
348
348
|
},
|
|
349
349
|
],
|
|
350
|
-
"@typescript-eslint/prefer-readonly": "
|
|
350
|
+
"@typescript-eslint/prefer-readonly": "error",
|
|
351
351
|
/** Superseded by the `complete/prefer-readonly-parameter-types` rule. */
|
|
352
352
|
"@typescript-eslint/prefer-readonly-parameter-types": "off",
|
|
353
|
-
"@typescript-eslint/prefer-reduce-type-parameter": "
|
|
353
|
+
"@typescript-eslint/prefer-reduce-type-parameter": "error",
|
|
354
354
|
/** Disabled since using the `String.match` form might make code easier to read. */
|
|
355
355
|
"@typescript-eslint/prefer-regexp-exec": "off",
|
|
356
|
-
"@typescript-eslint/prefer-return-this-type": "
|
|
357
|
-
"@typescript-eslint/prefer-string-starts-ends-with": "
|
|
358
|
-
"@typescript-eslint/prefer-ts-expect-error": "
|
|
359
|
-
"@typescript-eslint/promise-function-async": "
|
|
360
|
-
"@typescript-eslint/related-getter-setter-pairs": "
|
|
361
|
-
"@typescript-eslint/require-array-sort-compare": "
|
|
362
|
-
"@typescript-eslint/require-await": "
|
|
356
|
+
"@typescript-eslint/prefer-return-this-type": "error",
|
|
357
|
+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
|
358
|
+
"@typescript-eslint/prefer-ts-expect-error": "error",
|
|
359
|
+
"@typescript-eslint/promise-function-async": "error",
|
|
360
|
+
"@typescript-eslint/related-getter-setter-pairs": "error",
|
|
361
|
+
"@typescript-eslint/require-array-sort-compare": "error",
|
|
362
|
+
"@typescript-eslint/require-await": "error",
|
|
363
363
|
/** The various "allow" options are disabled to make the rule stricter. */
|
|
364
364
|
"@typescript-eslint/restrict-plus-operands": [
|
|
365
|
-
"
|
|
365
|
+
"error",
|
|
366
366
|
{
|
|
367
367
|
allowAny: false,
|
|
368
368
|
allowBoolean: false,
|
|
@@ -383,12 +383,12 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
383
383
|
* reasons described in [this
|
|
384
384
|
* issue](https://github.com/typescript-eslint/typescript-eslint/issues/10165#issuecomment-2525288217).
|
|
385
385
|
*/
|
|
386
|
-
"@typescript-eslint/return-await": ["
|
|
386
|
+
"@typescript-eslint/return-await": ["error", "always"],
|
|
387
387
|
/** Disabled since in it does not make sense to sort a union alphabetically in many cases. */
|
|
388
388
|
"@typescript-eslint/sort-type-constituents": "off",
|
|
389
389
|
/** The `allowString` and `allowNumber` options are disabled to make the rule stricter. */
|
|
390
390
|
"@typescript-eslint/strict-boolean-expressions": [
|
|
391
|
-
"
|
|
391
|
+
"error",
|
|
392
392
|
{
|
|
393
393
|
allowString: false,
|
|
394
394
|
allowNumber: false,
|
|
@@ -408,23 +408,23 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
408
408
|
* when `allowDefaultCaseForExhaustiveSwitch` is disabled.
|
|
409
409
|
*/
|
|
410
410
|
"@typescript-eslint/switch-exhaustiveness-check": [
|
|
411
|
-
"
|
|
411
|
+
"error",
|
|
412
412
|
{
|
|
413
413
|
allowDefaultCaseForExhaustiveSwitch: false,
|
|
414
414
|
requireDefaultForNonUnion: true,
|
|
415
415
|
considerDefaultExhaustiveForUnions: true,
|
|
416
416
|
},
|
|
417
417
|
],
|
|
418
|
-
"@typescript-eslint/triple-slash-reference": "
|
|
418
|
+
"@typescript-eslint/triple-slash-reference": "error",
|
|
419
419
|
/**
|
|
420
420
|
* Disabled since it is not recommended by the `typescript-eslint` team. (They recommend using
|
|
421
421
|
* the `noImplicitAny` and `strictPropertyInitialization` TypeScript compiler options
|
|
422
422
|
* instead.)
|
|
423
423
|
*/
|
|
424
424
|
"@typescript-eslint/typedef": "off",
|
|
425
|
-
"@typescript-eslint/unbound-method": "
|
|
426
|
-
"@typescript-eslint/unified-signatures": "
|
|
427
|
-
"@typescript-eslint/use-unknown-in-catch-callback-variable": "
|
|
425
|
+
"@typescript-eslint/unbound-method": "error",
|
|
426
|
+
"@typescript-eslint/unified-signatures": "error",
|
|
427
|
+
"@typescript-eslint/use-unknown-in-catch-callback-variable": "error",
|
|
428
428
|
},
|
|
429
429
|
// Rules that require type information will throw an error on ".json" files. (This is needed
|
|
430
430
|
// when using `eslint-plugin-package-json`. Even though this config does not currently use the
|