@hg-ts/linter 0.1.55 → 0.1.56

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/eslint.config.mjs +0 -610
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hg-ts/linter",
3
- "version": "0.1.55",
3
+ "version": "0.1.56",
4
4
  "bin": {
5
5
  "lint-ts": "bin/lint-ts.mjs"
6
6
  },
package/eslint.config.mjs DELETED
@@ -1,610 +0,0 @@
1
- import tsEslint from 'typescript-eslint';
2
- import stylisticEslint from '@stylistic/eslint-plugin';
3
- import globals from 'globals';
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': 'error',
191
- 'comma-dangle': [
192
- 'error',
193
- 'always-multiline',
194
- ],
195
- 'comma-spacing': 'error',
196
- 'comma-style': 'error',
197
- 'computed-property-spacing': 'error',
198
- 'consistent-this': 'off',
199
- 'eol-last': 'error',
200
- 'func-call-spacing': 'error',
201
- 'func-name-matching': 'error',
202
- 'func-names': 'off',
203
- 'func-style': [
204
- 'error',
205
- 'declaration',
206
- {
207
- 'allowArrowFunctions': true,
208
- },
209
- ],
210
- 'function-call-argument-newline': [
211
- 'error',
212
- 'consistent',
213
- ],
214
- 'function-paren-newline': 'off',
215
- 'id-denylist': 'off',
216
- 'id-length': 'off',
217
- 'id-match': 'off',
218
- 'implicit-arrow-linebreak': 'error',
219
- 'indent': [
220
- 'error',
221
- 'tab',
222
- ],
223
- 'jsx-quotes': 'error',
224
- 'key-spacing': 'error',
225
- 'keyword-spacing': 'error',
226
- 'line-comment-position': 'error',
227
- 'linebreak-style': 'error',
228
- 'lines-around-comment': 'off',
229
- 'lines-between-class-members': 'off',
230
- 'max-depth': [
231
- 'error',
232
- 3,
233
- ],
234
- 'max-len': [
235
- 'error',
236
- {
237
- 'code': 120,
238
- 'tabWidth': 2,
239
- 'comments': 150,
240
- },
241
- ],
242
- 'max-lines': [
243
- 'error',
244
- {
245
- 'max': 500,
246
- 'skipBlankLines': false,
247
- 'skipComments': false,
248
- },
249
- ],
250
- 'max-lines-per-function': [
251
- 'error',
252
- 50,
253
- ],
254
- 'max-nested-callbacks': [
255
- 'error',
256
- 3,
257
- ],
258
- 'max-params': [
259
- 'error',
260
- 3,
261
- ],
262
- 'max-statements': 'off',
263
- 'max-statements-per-line': 'error',
264
- 'multiline-comment-style': 'error',
265
- 'multiline-ternary': [
266
- 'error',
267
- 'always-multiline',
268
- ],
269
- 'new-cap': 'off',
270
- 'new-parens': 'error',
271
- 'newline-per-chained-call': ['error', { ignoreChainWithDepth: 3 }],
272
- 'no-array-constructor': 'error',
273
- 'no-bitwise': 'error',
274
- 'no-continue': 'off',
275
- 'no-inline-comments': 'error',
276
- 'no-lonely-if': 'error',
277
- 'no-mixed-operators': 'error',
278
- 'no-mixed-spaces-and-tabs': 'error',
279
- 'no-multi-assign': 'error',
280
- 'no-multiple-empty-lines': [
281
- 'error',
282
- {
283
- 'max': 2,
284
- 'maxEOF': 0,
285
- 'maxBOF': 0,
286
- },
287
- ],
288
- 'no-negated-condition': 'error',
289
- 'no-nested-ternary': 'error',
290
- 'no-new-object': 'error',
291
- 'no-plusplus': 'off',
292
- 'no-restricted-syntax': 'off',
293
- 'no-tabs': [
294
- 'error',
295
- {
296
- 'allowIndentationTabs': true,
297
- },
298
- ],
299
- 'no-ternary': 'off',
300
- 'no-trailing-spaces': 'error',
301
- 'no-underscore-dangle': 'error',
302
- 'no-unneeded-ternary': 'error',
303
- 'no-whitespace-before-property': 'error',
304
- 'nonblock-statement-body-position': 'error',
305
- 'object-curly-newline': [
306
- 'error',
307
- {
308
- 'multiline': true,
309
- },
310
- ],
311
- 'object-curly-spacing': [
312
- 'error',
313
- 'always',
314
- ],
315
- 'object-property-newline': [
316
- 'error',
317
- {
318
- 'allowAllPropertiesOnSameLine': true,
319
- },
320
- ],
321
- 'one-var': [
322
- 'error',
323
- 'never',
324
- ],
325
- 'one-var-declaration-per-line': 'error',
326
- 'operator-assignment': 'error',
327
- 'operator-linebreak': [
328
- 'error',
329
- 'before',
330
- {
331
- 'overrides': {
332
- '=': 'after',
333
- },
334
- },
335
- ],
336
- 'padded-blocks': [
337
- 'error',
338
- 'never',
339
- ],
340
- 'padding-line-between-statements': 'warn',
341
- 'prefer-exponentiation-operator': 'error',
342
- 'prefer-object-spread': 'error',
343
- 'quote-props': [
344
- 'error',
345
- 'consistent-as-needed',
346
- ],
347
- 'quotes': [
348
- 'error',
349
- 'single',
350
- ],
351
- 'semi': 'error',
352
- 'semi-spacing': 'error',
353
- 'semi-style': 'error',
354
- 'sort-keys': 'off',
355
- 'sort-vars': 'error',
356
- 'space-before-blocks': 'error',
357
- 'space-before-function-paren': [
358
- 'error',
359
- 'never',
360
- ],
361
- 'space-in-parens': 'error',
362
- 'space-infix-ops': 'error',
363
- 'space-unary-ops': 'error',
364
- 'spaced-comment': 'error',
365
- 'switch-colon-spacing': 'error',
366
- 'template-tag-spacing': 'error',
367
- 'unicode-bom': 'error',
368
- 'wrap-regex': 'error',
369
- 'arrow-body-style': 'error',
370
- 'arrow-parens': [
371
- 'error',
372
- 'as-needed',
373
- ],
374
- 'arrow-spacing': 'error',
375
- 'constructor-super': 'error',
376
- 'generator-star-spacing': 'error',
377
- 'no-class-assign': 'error',
378
- 'no-confusing-arrow': 'error',
379
- 'no-const-assign': 'error',
380
- 'no-dupe-class-members': 'off',
381
- 'no-duplicate-imports': 'error',
382
- 'no-new-symbol': 'error',
383
- 'no-restricted-exports': 'off',
384
- 'no-restricted-imports': 'off',
385
- 'no-this-before-super': 'error',
386
- 'no-useless-computed-key': 'error',
387
- 'no-useless-constructor': 'off',
388
- 'no-useless-rename': 'error',
389
- 'no-var': 'error',
390
- 'object-shorthand': 'error',
391
- 'prefer-arrow-callback': 'error',
392
- 'prefer-const': 'error',
393
- 'prefer-destructuring': 'error',
394
- 'prefer-numeric-literals': 'error',
395
- 'prefer-rest-params': 'error',
396
- 'prefer-spread': 'error',
397
- 'prefer-template': 'error',
398
- 'require-yield': 'error',
399
- 'rest-spread-spacing': 'error',
400
- 'sort-imports': 'off',
401
- 'symbol-description': 'error',
402
- 'template-curly-spacing': 'error',
403
- 'yield-star-spacing': 'error',
404
- 'wrap-iife': 'off',
405
- 'require-jsdoc': 'off',
406
- 'no-func-assign': 'error',
407
- };
408
-
409
- /**
410
- * @type {Linter.Config['rules']}
411
- */
412
- const typescriptRules = {
413
- '@typescript/adjacent-overload-signatures': 'error',
414
- '@typescript/array-type': 'error',
415
- '@typescript/await-thenable': 'error',
416
- '@typescript/ban-ts-comment': 'off',
417
- '@typescript/ban-tslint-comment': 'error',
418
- '@typescript/ban-types': 'off',
419
- '@typescript/class-literal-property-style': [
420
- 'error',
421
- 'fields',
422
- ],
423
- '@typescript/consistent-indexed-object-style': [
424
- 'error',
425
- 'record',
426
- ],
427
- '@typescript/consistent-type-assertions': [
428
- 'error',
429
- {
430
- 'assertionStyle': 'as',
431
- },
432
- ],
433
- '@typescript/consistent-type-definitions': [
434
- 'error',
435
- 'type',
436
- ],
437
- '@typescript/consistent-type-imports': 'off',
438
- '@typescript/explicit-function-return-type': 'error',
439
- '@typescript/explicit-member-accessibility': 'error',
440
- '@typescript/explicit-module-boundary-types': 'error',
441
- '@typescript/member-ordering': [
442
- 'error',
443
- {
444
- 'default': [
445
- 'signature',
446
- 'public-decorated-field',
447
- 'public-instance-field',
448
- 'protected-decorated-field',
449
- 'protected-instance-field',
450
- 'private-decorated-field',
451
- 'private-instance-field',
452
- 'public-static-field',
453
- 'protected-static-field',
454
- 'private-static-field',
455
- 'public-abstract-field',
456
- 'protected-abstract-field',
457
- 'public-constructor',
458
- 'protected-constructor',
459
- 'private-constructor',
460
- 'public-decorated-method',
461
- 'public-instance-method',
462
- 'public-abstract-method',
463
- 'public-static-method',
464
- 'protected-decorated-method',
465
- 'protected-instance-method',
466
- 'protected-abstract-method',
467
- 'protected-static-method',
468
- 'private-decorated-method',
469
- 'private-instance-method',
470
- 'private-static-method',
471
- ],
472
- },
473
- ],
474
- '@typescript/method-signature-style': [
475
- 'error',
476
- 'method',
477
- ],
478
- '@typescript/naming-convention': [
479
- 'off',
480
- ],
481
- '@typescript/no-base-to-string': 'error',
482
- '@typescript/no-confusing-non-null-assertion': 'error',
483
- '@typescript/no-confusing-void-expression': [
484
- 'error',
485
- {
486
- 'ignoreArrowShorthand': true,
487
- },
488
- ],
489
- '@typescript/no-dynamic-delete': 'error',
490
- '@typescript/no-empty-interface': 'error',
491
- '@typescript/no-explicit-any': 'off',
492
- '@typescript/no-extraneous-class': 'off',
493
- '@typescript/no-floating-promises': 'error',
494
- '@typescript/no-for-in-array': 'error',
495
- '@typescript/no-inferrable-types': 'error',
496
- '@typescript/no-invalid-void-type': 'error',
497
- '@typescript/no-misused-new': 'error',
498
- '@typescript/no-misused-promises': 'error',
499
- '@typescript/no-extra-non-null-assertion': 'error',
500
- '@typescript/no-namespace': 'off',
501
- '@typescript/no-non-null-asserted-optional-chain': 'error',
502
- '@typescript/no-non-null-assertion': 'off',
503
- '@typescript/parameter-properties': [
504
- 'error',
505
- {
506
- 'allow': [
507
- 'private readonly',
508
- 'protected readonly',
509
- ],
510
- },
511
- ],
512
- '@typescript/no-require-imports': 'error',
513
- '@typescript/no-this-alias': 'error',
514
- '@typescript/no-type-alias': 'off',
515
- '@typescript/no-unnecessary-type-assertion': 'error',
516
- '@typescript/no-unnecessary-boolean-literal-compare': 'error',
517
- '@typescript/no-unnecessary-condition': 'error',
518
- '@typescript/no-unnecessary-qualifier': 'error',
519
- '@typescript/no-unnecessary-type-arguments': 'error',
520
- '@typescript/no-unnecessary-type-constraint': 'error',
521
- '@typescript/no-unsafe-assignment': 'off',
522
- '@typescript/no-unsafe-call': 'off',
523
- '@typescript/no-unsafe-member-access': 'off',
524
- '@typescript/no-unsafe-return': 'off',
525
- '@typescript/no-var-requires': 'error',
526
- '@typescript/non-nullable-type-assertion-style': 'error',
527
- '@typescript/prefer-as-const': 'error',
528
- '@typescript/prefer-enum-initializers': 'error',
529
- '@typescript/prefer-for-of': 'error',
530
- '@typescript/prefer-function-type': 'error',
531
- '@typescript/prefer-includes': 'error',
532
- '@typescript/prefer-literal-enum-member': 'error',
533
- '@typescript/prefer-namespace-keyword': 'error',
534
- '@typescript/prefer-optional-chain': 'error',
535
- '@typescript/prefer-readonly': 'error',
536
- '@typescript/prefer-readonly-parameter-types': 'off',
537
- '@typescript/prefer-reduce-type-parameter': 'error',
538
- '@typescript/prefer-regexp-exec': 'error',
539
- '@typescript/prefer-string-starts-ends-with': 'error',
540
- '@typescript/prefer-ts-expect-error': 'error',
541
- '@typescript/promise-function-async': 'error',
542
- '@typescript/require-array-sort-compare': [
543
- 'error',
544
- {
545
- 'ignoreStringArrays': true,
546
- },
547
- ],
548
- '@typescript/restrict-plus-operands': 'error',
549
- '@typescript/restrict-template-expressions': 'error',
550
- '@typescript/strict-boolean-expressions': 'off',
551
- '@typescript/switch-exhaustiveness-check': [
552
- 'error',
553
- { considerDefaultExhaustiveForUnions: true },
554
- ],
555
- '@typescript/triple-slash-reference': 'error',
556
- '@typescript/typedef': 'error',
557
- '@typescript/unbound-method': 'error',
558
- '@typescript/unified-signatures': 'error',
559
- };
560
-
561
- /**
562
- * @type {Linter.FlatConfig['rules']}
563
- */
564
- const stylisticRules = {
565
- '@stylistic/member-delimiter-style': 'error',
566
- '@stylistic/type-annotation-spacing': 'error',
567
- };
568
-
569
- /**
570
- * @type {Linter.FlatConfig['plugins']}
571
- */
572
- const plugins = { '@typescript': tsEslint.plugin, '@stylistic': stylisticEslint };
573
-
574
- /**
575
- * @type {Linter.FlatConfig}
576
- */
577
- const config = {
578
- plugins,
579
- files: [
580
- '**/*.ts',
581
- '**/*.tsx',
582
- ],
583
- linterOptions: {
584
- reportUnusedDisableDirectives: 'warn',
585
- },
586
- ignores: [ '**/*.d.ts' ],
587
- languageOptions: {
588
- parser: tsEslint.parser,
589
- ecmaVersion: 'latest',
590
- sourceType: 'module',
591
- globals: {
592
- ...globals.browser,
593
- ...globals.node,
594
- },
595
- parserOptions: {
596
- project: './tsconfig.json',
597
- lib: [ 'ESNext' ],
598
- ecmaFeatures: {
599
- jsx: true,
600
- },
601
- },
602
- },
603
- rules: {
604
- ...commonRules,
605
- ...typescriptRules,
606
- ...stylisticRules,
607
- },
608
- };
609
-
610
- export default config;