eslint-config-isaacscript 2.0.0 → 3.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/base.js +75 -20
- package/mod.js +23 -6
- package/package.json +1 -1
package/base.js
CHANGED
|
@@ -20,15 +20,17 @@ module.exports = {
|
|
|
20
20
|
"airbnb-typescript/base",
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* We extend the Airbnb rules with the "recommended"
|
|
24
|
-
* rules from the "typescript-eslint" plugin, which is also recommended by Matt
|
|
25
|
-
* author of "airbnb-typescript/base":
|
|
23
|
+
* We extend the Airbnb rules with the "recommended", "recommended-requiring-type-checking", and
|
|
24
|
+
* "strict" rules from the "typescript-eslint" plugin, which is also recommended by Matt
|
|
25
|
+
* Turnbull, the author of "airbnb-typescript/base":
|
|
26
26
|
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/README.md#recommended
|
|
27
27
|
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended.ts
|
|
28
28
|
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts
|
|
29
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict.ts
|
|
29
30
|
*/
|
|
30
31
|
"plugin:@typescript-eslint/recommended",
|
|
31
32
|
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
33
|
+
"plugin:@typescript-eslint/strict",
|
|
32
34
|
|
|
33
35
|
/**
|
|
34
36
|
* This provides extra miscellaneous rules to keep code safe:
|
|
@@ -73,7 +75,7 @@ module.exports = {
|
|
|
73
75
|
rules: {
|
|
74
76
|
/**
|
|
75
77
|
* Documentation:
|
|
76
|
-
* https://
|
|
78
|
+
* https://typescript-eslint.io/rules/array-type
|
|
77
79
|
*
|
|
78
80
|
* Not defined in the parent configs.
|
|
79
81
|
*
|
|
@@ -88,7 +90,7 @@ module.exports = {
|
|
|
88
90
|
|
|
89
91
|
/**
|
|
90
92
|
* Documentation:
|
|
91
|
-
* https://
|
|
93
|
+
* https://typescript-eslint.io/rules/explicit-module-boundary-types
|
|
92
94
|
*
|
|
93
95
|
* Not defined in the parent configs.
|
|
94
96
|
*
|
|
@@ -99,7 +101,7 @@ module.exports = {
|
|
|
99
101
|
|
|
100
102
|
/**
|
|
101
103
|
* Documentation:
|
|
102
|
-
* https://
|
|
104
|
+
* https://typescript-eslint.io/rules/lines-between-class-members
|
|
103
105
|
*
|
|
104
106
|
* Defined at:
|
|
105
107
|
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js
|
|
@@ -117,7 +119,7 @@ module.exports = {
|
|
|
117
119
|
|
|
118
120
|
/**
|
|
119
121
|
* Documentation:
|
|
120
|
-
* https://
|
|
122
|
+
* https://typescript-eslint.io/rules/naming-convention
|
|
121
123
|
*
|
|
122
124
|
* Defined at:
|
|
123
125
|
* https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/lib/shared.js
|
|
@@ -151,7 +153,7 @@ module.exports = {
|
|
|
151
153
|
|
|
152
154
|
/**
|
|
153
155
|
* Documentation:
|
|
154
|
-
* https://
|
|
156
|
+
* https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare
|
|
155
157
|
*
|
|
156
158
|
* Not defined in the parent configs.
|
|
157
159
|
*
|
|
@@ -161,7 +163,7 @@ module.exports = {
|
|
|
161
163
|
|
|
162
164
|
/**
|
|
163
165
|
* Documentation:
|
|
164
|
-
* https://
|
|
166
|
+
* https://typescript-eslint.io/rules/no-unused-vars
|
|
165
167
|
*
|
|
166
168
|
* Defined at:
|
|
167
169
|
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/variables.js
|
|
@@ -181,7 +183,7 @@ module.exports = {
|
|
|
181
183
|
|
|
182
184
|
/**
|
|
183
185
|
* Documentation:
|
|
184
|
-
* https://
|
|
186
|
+
* https://typescript-eslint.io/rules/no-use-before-define
|
|
185
187
|
*
|
|
186
188
|
* Defined at:
|
|
187
189
|
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/variables.js
|
|
@@ -192,7 +194,20 @@ module.exports = {
|
|
|
192
194
|
|
|
193
195
|
/**
|
|
194
196
|
* Documentation:
|
|
195
|
-
* https://
|
|
197
|
+
* https://typescript-eslint.io/rules/prefer-optional-chain
|
|
198
|
+
*
|
|
199
|
+
* Defined at:
|
|
200
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict.ts
|
|
201
|
+
*
|
|
202
|
+
* This can modify the type of boolean declarations to "boolean | undefined", which is undesired
|
|
203
|
+
* in some circumstances:
|
|
204
|
+
* https://github.com/typescript-eslint/typescript-eslint/issues/5269
|
|
205
|
+
*/
|
|
206
|
+
"@typescript-eslint/prefer-optional-chain": "off",
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Documentation:
|
|
210
|
+
* https://typescript-eslint.io/rules/quotes
|
|
196
211
|
*
|
|
197
212
|
* Defined at:
|
|
198
213
|
* https://github.com/prettier/eslint-config-prettier/blob/main/%40typescript-eslint.js
|
|
@@ -212,7 +227,7 @@ module.exports = {
|
|
|
212
227
|
|
|
213
228
|
/**
|
|
214
229
|
* Documentation:
|
|
215
|
-
* https://
|
|
230
|
+
* https://typescript-eslint.io/rules/restrict-template-expressions
|
|
216
231
|
*
|
|
217
232
|
* Defined at:
|
|
218
233
|
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts
|
|
@@ -224,7 +239,7 @@ module.exports = {
|
|
|
224
239
|
|
|
225
240
|
/**
|
|
226
241
|
* Documentation:
|
|
227
|
-
* https://
|
|
242
|
+
* https://typescript-eslint.io/rules/strict-boolean-expressions
|
|
228
243
|
*
|
|
229
244
|
* Not defined in the parent configs.
|
|
230
245
|
*
|
|
@@ -243,18 +258,58 @@ module.exports = {
|
|
|
243
258
|
},
|
|
244
259
|
],
|
|
245
260
|
|
|
261
|
+
/**
|
|
262
|
+
* Documentation:
|
|
263
|
+
* https://typescript-eslint.io/rules/switch-exhaustiveness-check/
|
|
264
|
+
*
|
|
265
|
+
* Not defined in the parent configs.
|
|
266
|
+
*
|
|
267
|
+
* This rule ensures type-safety with switch statements, which can be especially helpful when
|
|
268
|
+
* values are added or removed from an enum.
|
|
269
|
+
*/
|
|
270
|
+
"@typescript-eslint/switch-exhaustiveness-check": "warn",
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Documentation:
|
|
274
|
+
* https://eslint.org/docs/latest/rules/consistent-return
|
|
275
|
+
*
|
|
276
|
+
* Defined at:
|
|
277
|
+
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/best-practices.js
|
|
278
|
+
*
|
|
279
|
+
* We prefer the "noImplicitReturns" compiler flag over the "consistent-return" ESLint rule,
|
|
280
|
+
* since it is type-aware:
|
|
281
|
+
* https://github.com/typescript-eslint/typescript-eslint/issues/5254
|
|
282
|
+
*/
|
|
283
|
+
"consistent-return": ["off"],
|
|
284
|
+
|
|
246
285
|
/**
|
|
247
286
|
* Documentation:
|
|
248
287
|
* https://eslint.org/docs/latest/rules/curly
|
|
249
288
|
*
|
|
250
|
-
* Defined at:
|
|
289
|
+
* Defined at:
|
|
290
|
+
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/best-practices.js
|
|
251
291
|
*
|
|
252
292
|
* Always requiring curly braces can partially ward against Apple-style if statement bugs:
|
|
253
293
|
* https://www.imperialviolet.org/2014/02/22/applebug.html
|
|
254
|
-
*
|
|
294
|
+
*
|
|
295
|
+
* Additionally, this rule needs to be set to "all" to work properly with
|
|
296
|
+
* `eslint-prettier-config`:
|
|
297
|
+
* https://github.com/prettier/eslint-config-prettier#curly
|
|
255
298
|
*/
|
|
256
299
|
curly: ["warn", "all"],
|
|
257
300
|
|
|
301
|
+
/**
|
|
302
|
+
* Documentation:
|
|
303
|
+
* https://eslint.org/docs/latest/rules/default-case
|
|
304
|
+
*
|
|
305
|
+
* Defined at:
|
|
306
|
+
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/best-practices.js
|
|
307
|
+
*
|
|
308
|
+
* This rule is generally bad to have on in TypeScript projects:
|
|
309
|
+
* https://github.com/typescript-eslint/typescript-eslint/issues/5254
|
|
310
|
+
*/
|
|
311
|
+
"default-case": "off",
|
|
312
|
+
|
|
258
313
|
/**
|
|
259
314
|
* Documentation:
|
|
260
315
|
* https://github.com/mysticatea/eslint-plugin-eslint-comments/blob/master/docs/rules/disable-enable-pair.md
|
|
@@ -308,7 +363,7 @@ module.exports = {
|
|
|
308
363
|
|
|
309
364
|
/**
|
|
310
365
|
* Documentation:
|
|
311
|
-
* https://eslint.org/docs/rules/no-console
|
|
366
|
+
* https://eslint.org/docs/latest/rules/no-console
|
|
312
367
|
*
|
|
313
368
|
* Defined at:
|
|
314
369
|
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/errors.js
|
|
@@ -330,7 +385,7 @@ module.exports = {
|
|
|
330
385
|
|
|
331
386
|
/**
|
|
332
387
|
* Documentation:
|
|
333
|
-
* https://eslint.org/docs/rules/no-continue
|
|
388
|
+
* https://eslint.org/docs/latest/rules/no-continue
|
|
334
389
|
*
|
|
335
390
|
* Defined at:
|
|
336
391
|
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js
|
|
@@ -341,7 +396,7 @@ module.exports = {
|
|
|
341
396
|
|
|
342
397
|
/**
|
|
343
398
|
* Documentation:
|
|
344
|
-
* https://eslint.org/docs/rules/no-plusplus
|
|
399
|
+
* https://eslint.org/docs/latest/rules/no-plusplus
|
|
345
400
|
*
|
|
346
401
|
* Defined at:
|
|
347
402
|
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js
|
|
@@ -358,7 +413,7 @@ module.exports = {
|
|
|
358
413
|
|
|
359
414
|
/**
|
|
360
415
|
* Documentation:
|
|
361
|
-
* https://eslint.org/docs/rules/no-restricted-syntax
|
|
416
|
+
* https://eslint.org/docs/latest/rules/no-restricted-syntax
|
|
362
417
|
*
|
|
363
418
|
* Defined at:
|
|
364
419
|
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js
|
|
@@ -392,7 +447,7 @@ module.exports = {
|
|
|
392
447
|
|
|
393
448
|
/**
|
|
394
449
|
* Documentation:
|
|
395
|
-
* https://eslint.org/docs/rules/prefer-destructuring
|
|
450
|
+
* https://eslint.org/docs/latest/rules/prefer-destructuring
|
|
396
451
|
*
|
|
397
452
|
* Defined at:
|
|
398
453
|
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/es6.js
|
package/mod.js
CHANGED
|
@@ -12,7 +12,7 @@ module.exports = {
|
|
|
12
12
|
rules: {
|
|
13
13
|
/**
|
|
14
14
|
* Documentation:
|
|
15
|
-
* https://
|
|
15
|
+
* https://typescript-eslint.io/rules/naming-convention
|
|
16
16
|
*
|
|
17
17
|
* Defined at:
|
|
18
18
|
* https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/lib/shared.js
|
|
@@ -54,7 +54,24 @@ module.exports = {
|
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Documentation:
|
|
57
|
-
* https://
|
|
57
|
+
* https://typescript-eslint.io/rules/no-invalid-void-type
|
|
58
|
+
*
|
|
59
|
+
* Defined at:
|
|
60
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict.ts
|
|
61
|
+
*
|
|
62
|
+
* TSTL has special behavior with respect to "this: void", so we need to configure this rule to
|
|
63
|
+
* allow the "this" parameter.
|
|
64
|
+
*/
|
|
65
|
+
"@typescript-eslint/no-invalid-void-type": [
|
|
66
|
+
"warn",
|
|
67
|
+
{
|
|
68
|
+
allowAsThisParameter: true,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Documentation:
|
|
74
|
+
* https://typescript-eslint.io/rules/no-loop-func
|
|
58
75
|
*
|
|
59
76
|
* Defined at:
|
|
60
77
|
* https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/lib/shared.js
|
|
@@ -87,7 +104,7 @@ module.exports = {
|
|
|
87
104
|
|
|
88
105
|
/**
|
|
89
106
|
* Documentation:
|
|
90
|
-
* https://
|
|
107
|
+
* https://eslint.org/docs/latest/rules/no-bitwise
|
|
91
108
|
*
|
|
92
109
|
* Defined at:
|
|
93
110
|
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js
|
|
@@ -98,7 +115,7 @@ module.exports = {
|
|
|
98
115
|
|
|
99
116
|
/**
|
|
100
117
|
* Documentation:
|
|
101
|
-
* https://eslint.org/docs/rules/no-param-reassign
|
|
118
|
+
* https://eslint.org/docs/latest/rules/no-param-reassign
|
|
102
119
|
*
|
|
103
120
|
* Defined at:
|
|
104
121
|
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/best-practices.js
|
|
@@ -109,7 +126,7 @@ module.exports = {
|
|
|
109
126
|
|
|
110
127
|
/**
|
|
111
128
|
* Documentation:
|
|
112
|
-
* https://eslint.org/docs/rules/no-restricted-globals
|
|
129
|
+
* https://eslint.org/docs/latest/rules/no-restricted-globals
|
|
113
130
|
*
|
|
114
131
|
* Defined at:
|
|
115
132
|
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/variables.js
|
|
@@ -120,7 +137,7 @@ module.exports = {
|
|
|
120
137
|
|
|
121
138
|
/**
|
|
122
139
|
* Documentation:
|
|
123
|
-
* https://eslint.org/docs/rules/no-underscore-dangle
|
|
140
|
+
* https://eslint.org/docs/latest/rules/no-underscore-dangle
|
|
124
141
|
*
|
|
125
142
|
* Defined at:
|
|
126
143
|
* https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js
|