@hg-ts/linter 0.5.13 → 0.5.15
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/eslint.config.js +620 -0
- package/package.json +3 -2
package/eslint.config.js
ADDED
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
import stylisticEslint from '@stylistic/eslint-plugin';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
import tsEslint from 'typescript-eslint';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @type {Linter.Config['rules']}
|
|
7
|
+
*/
|
|
8
|
+
const commonRules = {
|
|
9
|
+
'for-direction': 'error',
|
|
10
|
+
'getter-return': [
|
|
11
|
+
'error',
|
|
12
|
+
{
|
|
13
|
+
'allowImplicit': true,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
'no-async-promise-executor': 'error',
|
|
17
|
+
'no-await-in-loop': 'off',
|
|
18
|
+
'no-compare-neg-zero': 'error',
|
|
19
|
+
'no-cond-assign': 'error',
|
|
20
|
+
'no-console': 'warn',
|
|
21
|
+
'no-constant-condition': 'error',
|
|
22
|
+
'no-control-regex': 'error',
|
|
23
|
+
'no-debugger': 'error',
|
|
24
|
+
'no-dupe-args': 'error',
|
|
25
|
+
'no-dupe-else-if': 'error',
|
|
26
|
+
'no-dupe-keys': 'error',
|
|
27
|
+
'no-duplicate-case': 'error',
|
|
28
|
+
'no-empty': 'error',
|
|
29
|
+
'no-empty-character-class': 'error',
|
|
30
|
+
'no-ex-assign': 'error',
|
|
31
|
+
'no-extra-boolean-cast': 'error',
|
|
32
|
+
'no-extra-parens': 'off',
|
|
33
|
+
'no-extra-semi': 'error',
|
|
34
|
+
'no-import-assign': 'error',
|
|
35
|
+
'no-inner-declarations': 'error',
|
|
36
|
+
'no-invalid-regexp': 'error',
|
|
37
|
+
'no-irregular-whitespace': 'error',
|
|
38
|
+
'no-loss-of-precision': 'error',
|
|
39
|
+
'no-misleading-character-class': 'error',
|
|
40
|
+
'no-obj-calls': 'error',
|
|
41
|
+
'no-promise-executor-return': 'off',
|
|
42
|
+
'no-prototype-builtins': 'off',
|
|
43
|
+
'no-regex-spaces': 'error',
|
|
44
|
+
'no-setter-return': 'error',
|
|
45
|
+
'no-sparse-arrays': 'error',
|
|
46
|
+
'no-template-curly-in-string': 'error',
|
|
47
|
+
'no-unexpected-multiline': 'error',
|
|
48
|
+
'no-unreachable': 'error',
|
|
49
|
+
'no-unreachable-loop': 'error',
|
|
50
|
+
'no-unsafe-finally': 'error',
|
|
51
|
+
'no-unsafe-negation': 'error',
|
|
52
|
+
'no-unsafe-optional-chaining': [
|
|
53
|
+
'error',
|
|
54
|
+
{
|
|
55
|
+
'disallowArithmeticOperators': true,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
'no-useless-backreference': 'error',
|
|
59
|
+
'use-isnan': 'error',
|
|
60
|
+
'valid-typeof': 'error',
|
|
61
|
+
'accessor-pairs': 'error',
|
|
62
|
+
'array-callback-return': [
|
|
63
|
+
'error',
|
|
64
|
+
{
|
|
65
|
+
'checkForEach': false,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
'block-scoped-var': 'error',
|
|
69
|
+
'class-methods-use-this': 'off',
|
|
70
|
+
'complexity': 'warn',
|
|
71
|
+
'consistent-return': 'error',
|
|
72
|
+
'curly': 'error',
|
|
73
|
+
'default-case': 'error',
|
|
74
|
+
'default-case-last': 'error',
|
|
75
|
+
'default-param-last': 'error',
|
|
76
|
+
'dot-location': [
|
|
77
|
+
'error',
|
|
78
|
+
'property',
|
|
79
|
+
],
|
|
80
|
+
'dot-notation': 'off',
|
|
81
|
+
'eqeqeq': 'error',
|
|
82
|
+
'grouped-accessor-pairs': [
|
|
83
|
+
'error',
|
|
84
|
+
'getBeforeSet',
|
|
85
|
+
],
|
|
86
|
+
'guard-for-in': 'off',
|
|
87
|
+
'max-classes-per-file': 'error',
|
|
88
|
+
'no-alert': 'error',
|
|
89
|
+
'no-caller': 'error',
|
|
90
|
+
'no-case-declarations': 'error',
|
|
91
|
+
'no-constructor-return': 'error',
|
|
92
|
+
'no-div-regex': 'error',
|
|
93
|
+
'no-else-return': 'error',
|
|
94
|
+
'no-empty-function': 'off',
|
|
95
|
+
'no-empty-pattern': 'error',
|
|
96
|
+
'no-eq-null': 'error',
|
|
97
|
+
'no-eval': 'error',
|
|
98
|
+
'no-extend-native': 'error',
|
|
99
|
+
'no-extra-bind': 'error',
|
|
100
|
+
'no-extra-label': 'error',
|
|
101
|
+
'no-fallthrough': 'error',
|
|
102
|
+
'no-floating-decimal': 'error',
|
|
103
|
+
'no-global-assign': 'error',
|
|
104
|
+
'no-implicit-coercion': [
|
|
105
|
+
'error',
|
|
106
|
+
{
|
|
107
|
+
'allow': [
|
|
108
|
+
'!!',
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
'no-implicit-globals': 'error',
|
|
113
|
+
'no-implied-eval': 'error',
|
|
114
|
+
'no-invalid-this': 'error',
|
|
115
|
+
'no-iterator': 'error',
|
|
116
|
+
'no-labels': 'error',
|
|
117
|
+
'no-lone-blocks': 'error',
|
|
118
|
+
'no-loop-func': 'error',
|
|
119
|
+
'no-magic-numbers': 'off',
|
|
120
|
+
'no-multi-spaces': 'error',
|
|
121
|
+
'no-multi-str': 'error',
|
|
122
|
+
'no-new': 'error',
|
|
123
|
+
'no-new-func': 'error',
|
|
124
|
+
'no-new-wrappers': 'error',
|
|
125
|
+
'no-nonoctal-decimal-escape': 'error',
|
|
126
|
+
'no-octal': 'error',
|
|
127
|
+
'no-octal-escape': 'error',
|
|
128
|
+
'no-param-reassign': 'error',
|
|
129
|
+
'no-proto': 'error',
|
|
130
|
+
'no-redeclare': 'error',
|
|
131
|
+
'no-restricted-properties': 'off',
|
|
132
|
+
'no-return-assign': 'error',
|
|
133
|
+
'no-return-await': 'error',
|
|
134
|
+
'no-script-url': 'error',
|
|
135
|
+
'no-self-assign': 'error',
|
|
136
|
+
'no-self-compare': 'error',
|
|
137
|
+
'no-sequences': 'error',
|
|
138
|
+
'no-throw-literal': 'error',
|
|
139
|
+
'no-unmodified-loop-condition': 'error',
|
|
140
|
+
'no-unused-expressions': 'error',
|
|
141
|
+
'no-unused-labels': 'error',
|
|
142
|
+
'no-useless-call': 'error',
|
|
143
|
+
'no-useless-catch': 'error',
|
|
144
|
+
'no-useless-concat': 'error',
|
|
145
|
+
'no-useless-escape': 'error',
|
|
146
|
+
'no-useless-return': 'error',
|
|
147
|
+
'no-void': 'error',
|
|
148
|
+
'no-warning-comments': 'off',
|
|
149
|
+
'no-with': 'error',
|
|
150
|
+
'prefer-promise-reject-errors': 'error',
|
|
151
|
+
'prefer-regex-literals': 'error',
|
|
152
|
+
'radix': 'error',
|
|
153
|
+
'require-await': 'off',
|
|
154
|
+
'require-unicode-regexp': 'error',
|
|
155
|
+
'vars-on-top': 'error',
|
|
156
|
+
'yoda': 'error',
|
|
157
|
+
'init-declarations': 'off',
|
|
158
|
+
'no-delete-var': 'error',
|
|
159
|
+
'no-label-var': 'error',
|
|
160
|
+
'no-restricted-globals': 'off',
|
|
161
|
+
'no-shadow': 'off',
|
|
162
|
+
'no-shadow-restricted-names': 'error',
|
|
163
|
+
'no-undef': 'off',
|
|
164
|
+
'no-undef-init': 'error',
|
|
165
|
+
'no-undefined': 'error',
|
|
166
|
+
'no-unused-vars': 'off',
|
|
167
|
+
'strict': 'off',
|
|
168
|
+
'no-use-before-define': 'off',
|
|
169
|
+
'array-bracket-newline': [
|
|
170
|
+
'error',
|
|
171
|
+
{
|
|
172
|
+
'multiline': true,
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
'array-bracket-spacing': 'error',
|
|
176
|
+
'array-element-newline': [
|
|
177
|
+
'error',
|
|
178
|
+
'consistent',
|
|
179
|
+
],
|
|
180
|
+
'block-spacing': 'error',
|
|
181
|
+
'brace-style': 'error',
|
|
182
|
+
'camelcase': [
|
|
183
|
+
'error',
|
|
184
|
+
{
|
|
185
|
+
'ignoreDestructuring': true,
|
|
186
|
+
'ignoreImports': true,
|
|
187
|
+
'ignoreGlobals': true,
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
'capitalized-comments': [
|
|
191
|
+
'error',
|
|
192
|
+
'always',
|
|
193
|
+
{
|
|
194
|
+
ignorePattern: 'v8\ ignore',
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
'comma-dangle': [
|
|
198
|
+
'error',
|
|
199
|
+
'always-multiline',
|
|
200
|
+
],
|
|
201
|
+
'comma-spacing': 'error',
|
|
202
|
+
'comma-style': 'error',
|
|
203
|
+
'computed-property-spacing': 'error',
|
|
204
|
+
'consistent-this': 'off',
|
|
205
|
+
'eol-last': 'error',
|
|
206
|
+
'func-call-spacing': 'error',
|
|
207
|
+
'func-name-matching': 'error',
|
|
208
|
+
'func-names': 'off',
|
|
209
|
+
'func-style': [
|
|
210
|
+
'error',
|
|
211
|
+
'declaration',
|
|
212
|
+
{
|
|
213
|
+
'allowArrowFunctions': true,
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
'function-call-argument-newline': [
|
|
217
|
+
'error',
|
|
218
|
+
'consistent',
|
|
219
|
+
],
|
|
220
|
+
'function-paren-newline': 'off',
|
|
221
|
+
'id-denylist': 'off',
|
|
222
|
+
'id-length': 'off',
|
|
223
|
+
'id-match': 'off',
|
|
224
|
+
'implicit-arrow-linebreak': 'error',
|
|
225
|
+
'indent': [
|
|
226
|
+
'error',
|
|
227
|
+
'tab',
|
|
228
|
+
],
|
|
229
|
+
'jsx-quotes': 'error',
|
|
230
|
+
'key-spacing': 'error',
|
|
231
|
+
'keyword-spacing': 'error',
|
|
232
|
+
'line-comment-position': 'error',
|
|
233
|
+
'linebreak-style': 'error',
|
|
234
|
+
'lines-around-comment': 'off',
|
|
235
|
+
'lines-between-class-members': 'off',
|
|
236
|
+
'max-depth': [
|
|
237
|
+
'error',
|
|
238
|
+
3,
|
|
239
|
+
],
|
|
240
|
+
'max-len': [
|
|
241
|
+
'error',
|
|
242
|
+
{
|
|
243
|
+
'code': 120,
|
|
244
|
+
'tabWidth': 2,
|
|
245
|
+
'comments': 150,
|
|
246
|
+
'ignoreStrings': true,
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
'max-lines': [
|
|
250
|
+
'error',
|
|
251
|
+
{
|
|
252
|
+
'max': 500,
|
|
253
|
+
'skipBlankLines': false,
|
|
254
|
+
'skipComments': false,
|
|
255
|
+
},
|
|
256
|
+
],
|
|
257
|
+
'max-lines-per-function': [
|
|
258
|
+
'error',
|
|
259
|
+
50,
|
|
260
|
+
],
|
|
261
|
+
'max-nested-callbacks': [
|
|
262
|
+
'error',
|
|
263
|
+
3,
|
|
264
|
+
],
|
|
265
|
+
'max-params': [
|
|
266
|
+
'error',
|
|
267
|
+
3,
|
|
268
|
+
],
|
|
269
|
+
'max-statements': 'off',
|
|
270
|
+
'max-statements-per-line': 'error',
|
|
271
|
+
'multiline-comment-style': 'error',
|
|
272
|
+
'multiline-ternary': [
|
|
273
|
+
'error',
|
|
274
|
+
'always-multiline',
|
|
275
|
+
],
|
|
276
|
+
'new-cap': 'off',
|
|
277
|
+
'new-parens': 'error',
|
|
278
|
+
'newline-per-chained-call': [
|
|
279
|
+
'error',
|
|
280
|
+
{ ignoreChainWithDepth: 3 },
|
|
281
|
+
],
|
|
282
|
+
'no-array-constructor': 'error',
|
|
283
|
+
'no-bitwise': 'error',
|
|
284
|
+
'no-continue': 'off',
|
|
285
|
+
'no-inline-comments': 'error',
|
|
286
|
+
'no-lonely-if': 'error',
|
|
287
|
+
'no-mixed-operators': 'error',
|
|
288
|
+
'no-mixed-spaces-and-tabs': 'error',
|
|
289
|
+
'no-multi-assign': 'error',
|
|
290
|
+
'no-multiple-empty-lines': [
|
|
291
|
+
'error',
|
|
292
|
+
{
|
|
293
|
+
'max': 2,
|
|
294
|
+
'maxEOF': 0,
|
|
295
|
+
'maxBOF': 0,
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
'no-negated-condition': 'error',
|
|
299
|
+
'no-nested-ternary': 'error',
|
|
300
|
+
'no-new-object': 'error',
|
|
301
|
+
'no-plusplus': 'off',
|
|
302
|
+
'no-restricted-syntax': 'off',
|
|
303
|
+
'no-tabs': [
|
|
304
|
+
'error',
|
|
305
|
+
{
|
|
306
|
+
'allowIndentationTabs': true,
|
|
307
|
+
},
|
|
308
|
+
],
|
|
309
|
+
'no-ternary': 'off',
|
|
310
|
+
'no-trailing-spaces': 'error',
|
|
311
|
+
'no-underscore-dangle': 'error',
|
|
312
|
+
'no-unneeded-ternary': 'error',
|
|
313
|
+
'no-whitespace-before-property': 'error',
|
|
314
|
+
'nonblock-statement-body-position': 'error',
|
|
315
|
+
'object-curly-newline': [
|
|
316
|
+
'error',
|
|
317
|
+
{
|
|
318
|
+
'multiline': true,
|
|
319
|
+
},
|
|
320
|
+
],
|
|
321
|
+
'object-curly-spacing': [
|
|
322
|
+
'error',
|
|
323
|
+
'always',
|
|
324
|
+
],
|
|
325
|
+
'object-property-newline': [
|
|
326
|
+
'error',
|
|
327
|
+
{
|
|
328
|
+
'allowAllPropertiesOnSameLine': true,
|
|
329
|
+
},
|
|
330
|
+
],
|
|
331
|
+
'one-var': [
|
|
332
|
+
'error',
|
|
333
|
+
'never',
|
|
334
|
+
],
|
|
335
|
+
'one-var-declaration-per-line': 'error',
|
|
336
|
+
'operator-assignment': 'error',
|
|
337
|
+
'operator-linebreak': [
|
|
338
|
+
'error',
|
|
339
|
+
'before',
|
|
340
|
+
{
|
|
341
|
+
'overrides': {
|
|
342
|
+
'=': 'after',
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
],
|
|
346
|
+
'padded-blocks': [
|
|
347
|
+
'error',
|
|
348
|
+
'never',
|
|
349
|
+
],
|
|
350
|
+
'padding-line-between-statements': 'warn',
|
|
351
|
+
'prefer-exponentiation-operator': 'error',
|
|
352
|
+
'prefer-object-spread': 'error',
|
|
353
|
+
'quote-props': [
|
|
354
|
+
'error',
|
|
355
|
+
'consistent-as-needed',
|
|
356
|
+
],
|
|
357
|
+
'quotes': [
|
|
358
|
+
'error',
|
|
359
|
+
'single',
|
|
360
|
+
],
|
|
361
|
+
'semi': 'error',
|
|
362
|
+
'semi-spacing': 'error',
|
|
363
|
+
'semi-style': 'error',
|
|
364
|
+
'sort-keys': 'off',
|
|
365
|
+
'sort-vars': 'error',
|
|
366
|
+
'space-before-blocks': 'error',
|
|
367
|
+
'space-before-function-paren': [
|
|
368
|
+
'error',
|
|
369
|
+
'never',
|
|
370
|
+
],
|
|
371
|
+
'space-in-parens': 'error',
|
|
372
|
+
'space-infix-ops': 'error',
|
|
373
|
+
'space-unary-ops': 'error',
|
|
374
|
+
'spaced-comment': 'error',
|
|
375
|
+
'switch-colon-spacing': 'error',
|
|
376
|
+
'template-tag-spacing': 'error',
|
|
377
|
+
'unicode-bom': 'error',
|
|
378
|
+
'wrap-regex': 'error',
|
|
379
|
+
'arrow-body-style': 'error',
|
|
380
|
+
'arrow-parens': [
|
|
381
|
+
'error',
|
|
382
|
+
'as-needed',
|
|
383
|
+
],
|
|
384
|
+
'arrow-spacing': 'error',
|
|
385
|
+
'constructor-super': 'error',
|
|
386
|
+
'generator-star-spacing': 'error',
|
|
387
|
+
'no-class-assign': 'error',
|
|
388
|
+
'no-confusing-arrow': 'error',
|
|
389
|
+
'no-const-assign': 'error',
|
|
390
|
+
'no-dupe-class-members': 'off',
|
|
391
|
+
'no-duplicate-imports': 'error',
|
|
392
|
+
'no-new-symbol': 'error',
|
|
393
|
+
'no-restricted-exports': 'off',
|
|
394
|
+
'no-restricted-imports': 'off',
|
|
395
|
+
'no-this-before-super': 'error',
|
|
396
|
+
'no-useless-computed-key': 'error',
|
|
397
|
+
'no-useless-constructor': 'off',
|
|
398
|
+
'no-useless-rename': 'error',
|
|
399
|
+
'no-var': 'error',
|
|
400
|
+
'object-shorthand': 'error',
|
|
401
|
+
'prefer-arrow-callback': 'error',
|
|
402
|
+
'prefer-const': 'error',
|
|
403
|
+
'prefer-destructuring': 'error',
|
|
404
|
+
'prefer-numeric-literals': 'error',
|
|
405
|
+
'prefer-rest-params': 'error',
|
|
406
|
+
'prefer-spread': 'error',
|
|
407
|
+
'prefer-template': 'error',
|
|
408
|
+
'require-yield': 'error',
|
|
409
|
+
'rest-spread-spacing': 'error',
|
|
410
|
+
'sort-imports': 'off',
|
|
411
|
+
'symbol-description': 'error',
|
|
412
|
+
'template-curly-spacing': 'error',
|
|
413
|
+
'yield-star-spacing': 'error',
|
|
414
|
+
'wrap-iife': 'off',
|
|
415
|
+
'require-jsdoc': 'off',
|
|
416
|
+
'no-func-assign': 'error',
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* @type {Linter.Config['rules']}
|
|
421
|
+
*/
|
|
422
|
+
const typescriptRules = {
|
|
423
|
+
'@typescript/adjacent-overload-signatures': 'error',
|
|
424
|
+
'@typescript/array-type': 'error',
|
|
425
|
+
'@typescript/await-thenable': 'error',
|
|
426
|
+
'@typescript/ban-ts-comment': 'off',
|
|
427
|
+
'@typescript/ban-tslint-comment': 'error',
|
|
428
|
+
'@typescript/ban-types': 'off',
|
|
429
|
+
'@typescript/class-literal-property-style': [
|
|
430
|
+
'error',
|
|
431
|
+
'fields',
|
|
432
|
+
],
|
|
433
|
+
'@typescript/consistent-indexed-object-style': [
|
|
434
|
+
'error',
|
|
435
|
+
'record',
|
|
436
|
+
],
|
|
437
|
+
'@typescript/consistent-type-assertions': [
|
|
438
|
+
'error',
|
|
439
|
+
{
|
|
440
|
+
'assertionStyle': 'as',
|
|
441
|
+
},
|
|
442
|
+
],
|
|
443
|
+
'@typescript/consistent-type-definitions': [
|
|
444
|
+
'error',
|
|
445
|
+
'type',
|
|
446
|
+
],
|
|
447
|
+
'@typescript/consistent-type-imports': 'off',
|
|
448
|
+
'@typescript/explicit-function-return-type': 'error',
|
|
449
|
+
'@typescript/explicit-member-accessibility': 'error',
|
|
450
|
+
'@typescript/explicit-module-boundary-types': 'error',
|
|
451
|
+
'@typescript/member-ordering': [
|
|
452
|
+
'error',
|
|
453
|
+
{
|
|
454
|
+
'default': [
|
|
455
|
+
'signature',
|
|
456
|
+
'public-decorated-field',
|
|
457
|
+
'public-instance-field',
|
|
458
|
+
'protected-decorated-field',
|
|
459
|
+
'protected-instance-field',
|
|
460
|
+
'private-decorated-field',
|
|
461
|
+
'private-instance-field',
|
|
462
|
+
'public-static-field',
|
|
463
|
+
'protected-static-field',
|
|
464
|
+
'private-static-field',
|
|
465
|
+
'public-abstract-field',
|
|
466
|
+
'protected-abstract-field',
|
|
467
|
+
'public-constructor',
|
|
468
|
+
'protected-constructor',
|
|
469
|
+
'private-constructor',
|
|
470
|
+
'public-decorated-method',
|
|
471
|
+
'public-instance-method',
|
|
472
|
+
'public-abstract-method',
|
|
473
|
+
'public-static-method',
|
|
474
|
+
'protected-decorated-method',
|
|
475
|
+
'protected-instance-method',
|
|
476
|
+
'protected-abstract-method',
|
|
477
|
+
'protected-static-method',
|
|
478
|
+
'private-decorated-method',
|
|
479
|
+
'private-instance-method',
|
|
480
|
+
'private-static-method',
|
|
481
|
+
],
|
|
482
|
+
},
|
|
483
|
+
],
|
|
484
|
+
'@typescript/method-signature-style': [
|
|
485
|
+
'error',
|
|
486
|
+
'method',
|
|
487
|
+
],
|
|
488
|
+
'@typescript/naming-convention': [
|
|
489
|
+
'off',
|
|
490
|
+
],
|
|
491
|
+
'@typescript/no-base-to-string': 'error',
|
|
492
|
+
'@typescript/no-confusing-non-null-assertion': 'error',
|
|
493
|
+
'@typescript/no-confusing-void-expression': [
|
|
494
|
+
'error',
|
|
495
|
+
{
|
|
496
|
+
'ignoreArrowShorthand': true,
|
|
497
|
+
},
|
|
498
|
+
],
|
|
499
|
+
'@typescript/no-dynamic-delete': 'error',
|
|
500
|
+
'@typescript/no-empty-interface': 'error',
|
|
501
|
+
'@typescript/no-explicit-any': 'off',
|
|
502
|
+
'@typescript/no-extraneous-class': 'off',
|
|
503
|
+
'@typescript/no-floating-promises': 'error',
|
|
504
|
+
'@typescript/no-for-in-array': 'error',
|
|
505
|
+
'@typescript/no-inferrable-types': 'error',
|
|
506
|
+
'@typescript/no-invalid-void-type': 'error',
|
|
507
|
+
'@typescript/no-misused-new': 'error',
|
|
508
|
+
'@typescript/no-misused-promises': 'error',
|
|
509
|
+
'@typescript/no-extra-non-null-assertion': 'error',
|
|
510
|
+
'@typescript/no-namespace': 'off',
|
|
511
|
+
'@typescript/no-non-null-asserted-optional-chain': 'error',
|
|
512
|
+
'@typescript/no-non-null-assertion': 'off',
|
|
513
|
+
'@typescript/parameter-properties': [
|
|
514
|
+
'error',
|
|
515
|
+
{
|
|
516
|
+
'allow': [
|
|
517
|
+
'private readonly',
|
|
518
|
+
'protected readonly',
|
|
519
|
+
],
|
|
520
|
+
},
|
|
521
|
+
],
|
|
522
|
+
'@typescript/no-require-imports': 'error',
|
|
523
|
+
'@typescript/no-this-alias': 'error',
|
|
524
|
+
'@typescript/no-type-alias': 'off',
|
|
525
|
+
'@typescript/no-unnecessary-type-assertion': 'error',
|
|
526
|
+
'@typescript/no-unnecessary-boolean-literal-compare': 'error',
|
|
527
|
+
'@typescript/no-unnecessary-condition': 'error',
|
|
528
|
+
'@typescript/no-unnecessary-qualifier': 'error',
|
|
529
|
+
'@typescript/no-unnecessary-type-arguments': 'error',
|
|
530
|
+
'@typescript/no-unnecessary-type-constraint': 'error',
|
|
531
|
+
'@typescript/no-unsafe-assignment': 'off',
|
|
532
|
+
'@typescript/no-unsafe-call': 'off',
|
|
533
|
+
'@typescript/no-unsafe-member-access': 'off',
|
|
534
|
+
'@typescript/no-unsafe-return': 'off',
|
|
535
|
+
'@typescript/no-var-requires': 'error',
|
|
536
|
+
'@typescript/non-nullable-type-assertion-style': 'error',
|
|
537
|
+
'@typescript/prefer-as-const': 'error',
|
|
538
|
+
'@typescript/prefer-enum-initializers': 'error',
|
|
539
|
+
'@typescript/prefer-for-of': 'error',
|
|
540
|
+
'@typescript/prefer-function-type': 'error',
|
|
541
|
+
'@typescript/prefer-includes': 'error',
|
|
542
|
+
'@typescript/prefer-literal-enum-member': 'error',
|
|
543
|
+
'@typescript/prefer-namespace-keyword': 'error',
|
|
544
|
+
'@typescript/prefer-optional-chain': 'error',
|
|
545
|
+
'@typescript/prefer-readonly': 'error',
|
|
546
|
+
'@typescript/prefer-readonly-parameter-types': 'off',
|
|
547
|
+
'@typescript/prefer-reduce-type-parameter': 'error',
|
|
548
|
+
'@typescript/prefer-regexp-exec': 'error',
|
|
549
|
+
'@typescript/prefer-string-starts-ends-with': 'error',
|
|
550
|
+
'@typescript/prefer-ts-expect-error': 'error',
|
|
551
|
+
'@typescript/promise-function-async': 'error',
|
|
552
|
+
'@typescript/require-array-sort-compare': [
|
|
553
|
+
'error',
|
|
554
|
+
{
|
|
555
|
+
'ignoreStringArrays': true,
|
|
556
|
+
},
|
|
557
|
+
],
|
|
558
|
+
'@typescript/restrict-plus-operands': 'error',
|
|
559
|
+
'@typescript/restrict-template-expressions': 'error',
|
|
560
|
+
'@typescript/strict-boolean-expressions': 'off',
|
|
561
|
+
'@typescript/switch-exhaustiveness-check': [
|
|
562
|
+
'error',
|
|
563
|
+
{ considerDefaultExhaustiveForUnions: true },
|
|
564
|
+
],
|
|
565
|
+
'@typescript/triple-slash-reference': 'error',
|
|
566
|
+
'@typescript/typedef': 'error',
|
|
567
|
+
'@typescript/unbound-method': 'error',
|
|
568
|
+
'@typescript/unified-signatures': 'error',
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* @type {Linter.FlatConfig['rules']}
|
|
573
|
+
*/
|
|
574
|
+
const stylisticRules = {
|
|
575
|
+
'@stylistic/member-delimiter-style': 'error',
|
|
576
|
+
'@stylistic/type-annotation-spacing': 'error',
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* @type {Linter.FlatConfig['plugins']}
|
|
581
|
+
*/
|
|
582
|
+
const plugins = { '@typescript': tsEslint.plugin, '@stylistic': stylisticEslint };
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* @type {Linter.FlatConfig}
|
|
586
|
+
*/
|
|
587
|
+
const config = {
|
|
588
|
+
plugins,
|
|
589
|
+
files: [
|
|
590
|
+
'**/*.ts',
|
|
591
|
+
'**/*.tsx',
|
|
592
|
+
],
|
|
593
|
+
linterOptions: {
|
|
594
|
+
reportUnusedDisableDirectives: 'warn',
|
|
595
|
+
},
|
|
596
|
+
ignores: [ '**/*.d.ts' ],
|
|
597
|
+
languageOptions: {
|
|
598
|
+
parser: tsEslint.parser,
|
|
599
|
+
ecmaVersion: 'latest',
|
|
600
|
+
sourceType: 'module',
|
|
601
|
+
globals: {
|
|
602
|
+
...globals.browser,
|
|
603
|
+
...globals.node,
|
|
604
|
+
},
|
|
605
|
+
parserOptions: {
|
|
606
|
+
project: './tsconfig.json',
|
|
607
|
+
lib: [ 'ESNext' ],
|
|
608
|
+
ecmaFeatures: {
|
|
609
|
+
jsx: true,
|
|
610
|
+
},
|
|
611
|
+
},
|
|
612
|
+
},
|
|
613
|
+
rules: {
|
|
614
|
+
...commonRules,
|
|
615
|
+
...typescriptRules,
|
|
616
|
+
...stylisticRules,
|
|
617
|
+
},
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
export default config;
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hg-ts/linter",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.15",
|
|
4
4
|
"bin": {
|
|
5
5
|
"lint-ts": "bin/lint-ts.mjs"
|
|
6
6
|
},
|
|
7
|
-
"
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./eslint.config.js",
|
|
8
9
|
"repository": "git@gitlab.com:hyper-graph/framework.git",
|
|
9
10
|
"packageManager": "yarn@4.6.0",
|
|
10
11
|
"license": "MIT",
|