eslint-config-complete 3.2.3 → 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.d.ts +1 -1
- package/dist/base/base-complete.d.ts.map +1 -1
- package/dist/base/base-complete.js +41 -41
- package/dist/base/base-eslint.d.ts +1 -1
- package/dist/base/base-eslint.d.ts.map +1 -1
- package/dist/base/base-eslint.js +124 -124
- package/dist/base/base-import-x.d.ts +1 -1
- package/dist/base/base-import-x.d.ts.map +1 -1
- package/dist/base/base-import-x.js +24 -24
- package/dist/base/base-jsdoc.d.ts +1 -1
- package/dist/base/base-jsdoc.d.ts.map +1 -1
- package/dist/base/base-jsdoc.js +31 -31
- package/dist/base/base-n.d.ts +1 -1
- package/dist/base/base-n.d.ts.map +1 -1
- package/dist/base/base-n.js +9 -9
- package/dist/base/base-stylistic.d.ts +1 -1
- package/dist/base/base-stylistic.d.ts.map +1 -1
- package/dist/base/base-stylistic.js +3 -3
- package/dist/base/base-typescript-eslint.d.ts +1 -1
- package/dist/base/base-typescript-eslint.d.ts.map +1 -1
- package/dist/base/base-typescript-eslint.js +114 -113
- package/dist/base/base-unicorn.d.ts +1 -1
- package/dist/base/base-unicorn.d.ts.map +1 -1
- package/dist/base/base-unicorn.js +129 -126
- package/dist/base.d.ts +1 -1
- package/dist/base.d.ts.map +1 -1
- package/dist/eslint-plugin.d.ts +1 -1
- package/dist/eslint-plugin.d.ts.map +1 -1
- package/dist/eslint-plugin.js +30 -30
- package/package.json +9 -9
|
@@ -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,51 +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": "error",
|
|
283
284
|
/**
|
|
284
285
|
* The `args` option is set to `all` make the rule stricter. Additionally, we ignore things
|
|
285
286
|
* that begin with an underscore, since this matches the behavior of the `--noUnusedLocals`
|
|
286
287
|
* TypeScript compiler flag.
|
|
287
288
|
*/
|
|
288
289
|
"@typescript-eslint/no-unused-vars": [
|
|
289
|
-
"
|
|
290
|
+
"error",
|
|
290
291
|
{
|
|
291
292
|
args: "all", // "after-used" is the default.
|
|
292
293
|
argsIgnorePattern: "^_",
|
|
@@ -295,20 +296,20 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
295
296
|
],
|
|
296
297
|
/** Disabled because it can prevent code from being structured sequentially. */
|
|
297
298
|
"@typescript-eslint/no-use-before-define": "off",
|
|
298
|
-
"@typescript-eslint/no-useless-constructor": "
|
|
299
|
-
"@typescript-eslint/no-useless-empty-export": "
|
|
300
|
-
"@typescript-eslint/no-var-requires": "
|
|
301
|
-
"@typescript-eslint/no-wrapper-object-types": "
|
|
302
|
-
"@typescript-eslint/non-nullable-type-assertion-style": "
|
|
303
|
-
"@typescript-eslint/only-throw-error": "
|
|
304
|
-
"@typescript-eslint/parameter-properties": "
|
|
305
|
-
"@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",
|
|
306
307
|
/**
|
|
307
308
|
* Object destructuring is enforced but array destructuring is not. This matches usage in the
|
|
308
309
|
* general TypeScript ecosystem.
|
|
309
310
|
*/
|
|
310
311
|
"@typescript-eslint/prefer-destructuring": [
|
|
311
|
-
"
|
|
312
|
+
"error",
|
|
312
313
|
{
|
|
313
314
|
VariableDeclarator: {
|
|
314
315
|
array: false,
|
|
@@ -325,14 +326,14 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
325
326
|
enforceForRenamedProperties: false,
|
|
326
327
|
},
|
|
327
328
|
],
|
|
328
|
-
"@typescript-eslint/prefer-enum-initializers": "
|
|
329
|
-
"@typescript-eslint/prefer-find": "
|
|
330
|
-
"@typescript-eslint/prefer-for-of": "
|
|
331
|
-
"@typescript-eslint/prefer-function-type": "
|
|
332
|
-
"@typescript-eslint/prefer-includes": "
|
|
333
|
-
"@typescript-eslint/prefer-literal-enum-member": "
|
|
334
|
-
"@typescript-eslint/prefer-namespace-keyword": "
|
|
335
|
-
"@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",
|
|
336
337
|
/**
|
|
337
338
|
* Disabled because it can modify the type of `boolean` declarations, which is [undesired in
|
|
338
339
|
* some
|
|
@@ -341,27 +342,27 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
341
342
|
"@typescript-eslint/prefer-optional-chain": "off",
|
|
342
343
|
/** The `allowEmptyReject` option is enabled since this is a common pattern. */
|
|
343
344
|
"@typescript-eslint/prefer-promise-reject-errors": [
|
|
344
|
-
"
|
|
345
|
+
"error",
|
|
345
346
|
{
|
|
346
347
|
allowEmptyReject: true,
|
|
347
348
|
},
|
|
348
349
|
],
|
|
349
|
-
"@typescript-eslint/prefer-readonly": "
|
|
350
|
+
"@typescript-eslint/prefer-readonly": "error",
|
|
350
351
|
/** Superseded by the `complete/prefer-readonly-parameter-types` rule. */
|
|
351
352
|
"@typescript-eslint/prefer-readonly-parameter-types": "off",
|
|
352
|
-
"@typescript-eslint/prefer-reduce-type-parameter": "
|
|
353
|
+
"@typescript-eslint/prefer-reduce-type-parameter": "error",
|
|
353
354
|
/** Disabled since using the `String.match` form might make code easier to read. */
|
|
354
355
|
"@typescript-eslint/prefer-regexp-exec": "off",
|
|
355
|
-
"@typescript-eslint/prefer-return-this-type": "
|
|
356
|
-
"@typescript-eslint/prefer-string-starts-ends-with": "
|
|
357
|
-
"@typescript-eslint/prefer-ts-expect-error": "
|
|
358
|
-
"@typescript-eslint/promise-function-async": "
|
|
359
|
-
"@typescript-eslint/related-getter-setter-pairs": "
|
|
360
|
-
"@typescript-eslint/require-array-sort-compare": "
|
|
361
|
-
"@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",
|
|
362
363
|
/** The various "allow" options are disabled to make the rule stricter. */
|
|
363
364
|
"@typescript-eslint/restrict-plus-operands": [
|
|
364
|
-
"
|
|
365
|
+
"error",
|
|
365
366
|
{
|
|
366
367
|
allowAny: false,
|
|
367
368
|
allowBoolean: false,
|
|
@@ -382,12 +383,12 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
382
383
|
* reasons described in [this
|
|
383
384
|
* issue](https://github.com/typescript-eslint/typescript-eslint/issues/10165#issuecomment-2525288217).
|
|
384
385
|
*/
|
|
385
|
-
"@typescript-eslint/return-await": ["
|
|
386
|
+
"@typescript-eslint/return-await": ["error", "always"],
|
|
386
387
|
/** Disabled since in it does not make sense to sort a union alphabetically in many cases. */
|
|
387
388
|
"@typescript-eslint/sort-type-constituents": "off",
|
|
388
389
|
/** The `allowString` and `allowNumber` options are disabled to make the rule stricter. */
|
|
389
390
|
"@typescript-eslint/strict-boolean-expressions": [
|
|
390
|
-
"
|
|
391
|
+
"error",
|
|
391
392
|
{
|
|
392
393
|
allowString: false,
|
|
393
394
|
allowNumber: false,
|
|
@@ -407,28 +408,28 @@ export const baseTypeScriptESLint = defineConfig({
|
|
|
407
408
|
* when `allowDefaultCaseForExhaustiveSwitch` is disabled.
|
|
408
409
|
*/
|
|
409
410
|
"@typescript-eslint/switch-exhaustiveness-check": [
|
|
410
|
-
"
|
|
411
|
+
"error",
|
|
411
412
|
{
|
|
412
413
|
allowDefaultCaseForExhaustiveSwitch: false,
|
|
413
414
|
requireDefaultForNonUnion: true,
|
|
414
415
|
considerDefaultExhaustiveForUnions: true,
|
|
415
416
|
},
|
|
416
417
|
],
|
|
417
|
-
"@typescript-eslint/triple-slash-reference": "
|
|
418
|
+
"@typescript-eslint/triple-slash-reference": "error",
|
|
418
419
|
/**
|
|
419
420
|
* Disabled since it is not recommended by the `typescript-eslint` team. (They recommend using
|
|
420
421
|
* the `noImplicitAny` and `strictPropertyInitialization` TypeScript compiler options
|
|
421
422
|
* instead.)
|
|
422
423
|
*/
|
|
423
424
|
"@typescript-eslint/typedef": "off",
|
|
424
|
-
"@typescript-eslint/unbound-method": "
|
|
425
|
-
"@typescript-eslint/unified-signatures": "
|
|
426
|
-
"@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",
|
|
427
428
|
},
|
|
428
429
|
// Rules that require type information will throw an error on ".json" files. (This is needed
|
|
429
430
|
// when using `eslint-plugin-package-json`. Even though this config does not currently use the
|
|
430
431
|
// plugin, we include it here defensively.)
|
|
431
|
-
ignores: ["
|
|
432
|
+
ignores: ["**/*.json", "**/*.jsonc"],
|
|
432
433
|
},
|
|
433
434
|
// Enable linting on TypeScript file extensions.
|
|
434
435
|
{
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* This ESLint config only contains rules from `eslint-plugin-unicorn`:
|
|
3
3
|
* https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
4
4
|
*/
|
|
5
|
-
export const baseUnicorn: import("eslint").
|
|
5
|
+
export const baseUnicorn: import("eslint/config").Config[];
|
|
6
6
|
//# sourceMappingURL=base-unicorn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-unicorn.d.ts","sourceRoot":"","sources":["../../src/base/base-unicorn.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"base-unicorn.d.ts","sourceRoot":"","sources":["../../src/base/base-unicorn.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,2DAqMG"}
|