eslint-config-complete 1.2.4 → 1.2.5
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/README.md +2 -2
- package/dist/base/base-complete.d.ts +6 -0
- package/dist/base/base-complete.d.ts.map +1 -0
- package/dist/base/base-complete.js +61 -0
- package/dist/base/base-eslint.d.ts +0 -1
- package/dist/base/base-eslint.d.ts.map +1 -1
- package/dist/base/base-eslint.js +0 -153
- package/dist/base/base-jsdoc.d.ts.map +1 -1
- package/dist/base/base-jsdoc.js +16 -18
- package/dist/base/base-n.d.ts.map +1 -1
- package/dist/base/base-n.js +2 -4
- package/dist/base/base-stylistic.d.ts.map +1 -1
- package/dist/base/base-stylistic.js +15 -0
- package/dist/base/base-typescript-eslint.d.ts.map +1 -1
- package/dist/base/base-typescript-eslint.js +119 -140
- package/dist/base/base-unicorn.d.ts.map +1 -1
- package/dist/base/base-unicorn.js +3 -0
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +4 -17
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/eslint-config-complete)
|
|
4
4
|
|
|
5
|
-
This is a sharable configuration for [ESLint](https://eslint.org/) that is intended to be used in TypeScript projects.
|
|
5
|
+
This is a sharable configuration for [ESLint](https://eslint.org/) that is intended to be used in TypeScript projects that want to be as safe as possible.
|
|
6
6
|
|
|
7
|
-
Please see the [docs](
|
|
7
|
+
Please see the [docs](https://complete-ts.github.io/eslint-config-complete) for more information.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This ESLint config only contains rules from `eslint-plugin-complete`:
|
|
3
|
+
* https://complete-ts.github.io/eslint-plugin-complete
|
|
4
|
+
*/
|
|
5
|
+
export const baseComplete: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
|
|
6
|
+
//# sourceMappingURL=base-complete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-complete.d.ts","sourceRoot":"","sources":["../../src/base/base-complete.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,+FA2DE"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import ESLintPluginComplete from "eslint-plugin-complete";
|
|
2
|
+
import tseslint from "typescript-eslint";
|
|
3
|
+
/**
|
|
4
|
+
* This ESLint config only contains rules from `eslint-plugin-complete`:
|
|
5
|
+
* https://complete-ts.github.io/eslint-plugin-complete
|
|
6
|
+
*/
|
|
7
|
+
export const baseComplete = tseslint.config({
|
|
8
|
+
plugins: {
|
|
9
|
+
complete: ESLintPluginComplete,
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
"complete/complete-sentences-jsdoc": "warn",
|
|
13
|
+
"complete/complete-sentences-line-comments": "warn",
|
|
14
|
+
"complete/consistent-enum-values": "warn",
|
|
15
|
+
"complete/consistent-named-tuples": "warn",
|
|
16
|
+
"complete/eqeqeq-fix": "warn",
|
|
17
|
+
"complete/format-jsdoc-comments": "warn",
|
|
18
|
+
"complete/format-line-comments": "warn",
|
|
19
|
+
"complete/jsdoc-code-block-language": "warn",
|
|
20
|
+
"complete/newline-between-switch-case": "warn",
|
|
21
|
+
"complete/no-confusing-set-methods": "warn",
|
|
22
|
+
"complete/no-empty-jsdoc": "warn",
|
|
23
|
+
"complete/no-empty-line-comments": "warn",
|
|
24
|
+
"complete/no-explicit-array-loops": "warn",
|
|
25
|
+
"complete/no-explicit-map-set-loops": "warn",
|
|
26
|
+
"complete/no-for-in": "warn",
|
|
27
|
+
"complete/no-let-any": "warn",
|
|
28
|
+
"complete/no-mutable-return": "warn",
|
|
29
|
+
"complete/no-number-enums": "warn",
|
|
30
|
+
"complete/no-object-any": "warn",
|
|
31
|
+
"complete/no-object-methods-with-map-set": "warn",
|
|
32
|
+
"complete/no-string-length-0": "warn",
|
|
33
|
+
"complete/no-template-curly-in-string-fix": "warn",
|
|
34
|
+
"complete/no-undefined-return-type": "warn",
|
|
35
|
+
"complete/no-unnecessary-assignment": "warn",
|
|
36
|
+
"complete/no-unsafe-plusplus": "warn",
|
|
37
|
+
"complete/no-useless-return": "warn",
|
|
38
|
+
"complete/no-void-return-type": "warn",
|
|
39
|
+
"complete/prefer-const": "warn",
|
|
40
|
+
"complete/prefer-plusplus": "warn",
|
|
41
|
+
"complete/prefer-postfix-plusplus": "warn",
|
|
42
|
+
"complete/prefer-readonly-parameter-types": "warn",
|
|
43
|
+
"complete/require-break": "warn",
|
|
44
|
+
"complete/require-capital-const-assertions": "warn",
|
|
45
|
+
"complete/require-capital-read-only": "warn",
|
|
46
|
+
"complete/require-unannotated-const-assertions": "warn",
|
|
47
|
+
"complete/require-variadic-function-argument": "warn",
|
|
48
|
+
"complete/strict-array-methods": "warn",
|
|
49
|
+
"complete/strict-enums": "warn",
|
|
50
|
+
"complete/strict-undefined-functions": "warn",
|
|
51
|
+
"complete/strict-void-functions": "warn",
|
|
52
|
+
},
|
|
53
|
+
}, {
|
|
54
|
+
files: ["**/*.js", "**/*.cjs", "**/*.mjs", "**/*.jsx"],
|
|
55
|
+
rules: {
|
|
56
|
+
"complete/no-let-any": "off",
|
|
57
|
+
"complete/no-object-any": "off",
|
|
58
|
+
"complete/require-capital-const-assertions": "off",
|
|
59
|
+
"complete/require-capital-read-only": "off",
|
|
60
|
+
},
|
|
61
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-eslint.d.ts","sourceRoot":"","sources":["../../src/base/base-eslint.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-eslint.d.ts","sourceRoot":"","sources":["../../src/base/base-eslint.js"],"names":[],"mappings":"AAwmBA;;;;;;;;GAQG;AACH,6FAMG"}
|
package/dist/base/base-eslint.js
CHANGED
|
@@ -46,7 +46,6 @@ const POSSIBLE_PROBLEMS = {
|
|
|
46
46
|
"no-loss-of-precision": "off",
|
|
47
47
|
"no-misleading-character-class": "warn",
|
|
48
48
|
"no-new-native-nonconstructor": "warn",
|
|
49
|
-
"no-new-symbol": "off", // @typescript-eslint/eslint-recommended
|
|
50
49
|
"no-obj-calls": "off", // @typescript-eslint/eslint-recommended`
|
|
51
50
|
"no-promise-executor-return": "warn",
|
|
52
51
|
"no-prototype-builtins": "warn",
|
|
@@ -175,8 +174,6 @@ const SUGGESTIONS = {
|
|
|
175
174
|
* does not provide much value.
|
|
176
175
|
*/
|
|
177
176
|
"max-statements": "off",
|
|
178
|
-
/** Disabled because it is conventional to use both kinds of comments in TypeScript projects. */
|
|
179
|
-
"multiline-comment-style": "off",
|
|
180
177
|
"new-cap": "warn",
|
|
181
178
|
"no-alert": "warn",
|
|
182
179
|
/** Superseded by the `@typescript-eslint/no-array-constructor` rule. */
|
|
@@ -184,7 +181,6 @@ const SUGGESTIONS = {
|
|
|
184
181
|
"no-bitwise": "warn",
|
|
185
182
|
"no-caller": "warn",
|
|
186
183
|
"no-case-declarations": "warn",
|
|
187
|
-
"no-confusing-arrow": "off", // eslint-config-prettier
|
|
188
184
|
/**
|
|
189
185
|
* Disabled because command-line programs written in TypeScript commonly write to standard out and
|
|
190
186
|
* standard error.
|
|
@@ -216,9 +212,6 @@ const SUGGESTIONS = {
|
|
|
216
212
|
"no-extra-bind": "warn",
|
|
217
213
|
"no-extra-boolean-cast": "warn",
|
|
218
214
|
"no-extra-label": "warn",
|
|
219
|
-
/** Superseded by the `@typescript-eslint/no-extra-semi` rule. */
|
|
220
|
-
"no-extra-semi": "off",
|
|
221
|
-
"no-floating-decimal": "off", // eslint-config-prettier
|
|
222
215
|
"no-global-assign": "warn",
|
|
223
216
|
"no-implicit-coercion": "warn",
|
|
224
217
|
"no-implicit-globals": "warn",
|
|
@@ -237,7 +230,6 @@ const SUGGESTIONS = {
|
|
|
237
230
|
"no-loop-func": "off",
|
|
238
231
|
/** Superseded by the `@typescript-eslint/no-magic-numbers` rule. */
|
|
239
232
|
"no-magic-numbers": "off",
|
|
240
|
-
"no-mixed-operators": "off", // eslint-config-prettier
|
|
241
233
|
"no-multi-assign": "warn",
|
|
242
234
|
"no-multi-str": "warn",
|
|
243
235
|
/** Superseded by the `unicorn/no-negated-condition` rule. */
|
|
@@ -449,7 +441,6 @@ const SUGGESTIONS = {
|
|
|
449
441
|
* confusing).
|
|
450
442
|
*/
|
|
451
443
|
"one-var": ["warn", "never"],
|
|
452
|
-
"one-var-declaration-per-line": "off", // eslint-config-prettier
|
|
453
444
|
"operator-assignment": "warn",
|
|
454
445
|
"prefer-arrow-callback": "warn",
|
|
455
446
|
/** Superseded by the `complete/prefer-const` rule (since the auto-fix is usually unwanted). */
|
|
@@ -477,7 +468,6 @@ const SUGGESTIONS = {
|
|
|
477
468
|
"prefer-rest-params": "warn",
|
|
478
469
|
"prefer-spread": "warn",
|
|
479
470
|
"prefer-template": "warn",
|
|
480
|
-
"quote-props": "off", // eslint-config-prettier
|
|
481
471
|
radix: "warn",
|
|
482
472
|
/** Superseded by the `@typescript-eslint/require-await` rule. */
|
|
483
473
|
"require-await": "off",
|
|
@@ -496,19 +486,6 @@ const SUGGESTIONS = {
|
|
|
496
486
|
* Disabled because variable declarations are often not meant to be sorted in alphabetical order.
|
|
497
487
|
*/
|
|
498
488
|
"sort-vars": "off",
|
|
499
|
-
/**
|
|
500
|
-
* Partially superseded by `complete/format-jsdoc-comments` and `complete/format-line-comments`,
|
|
501
|
-
* but those rules do not handle trailing line comments.
|
|
502
|
-
*
|
|
503
|
-
* The `markers` option is provided to make this rule ignore lines that start with "///".
|
|
504
|
-
*/
|
|
505
|
-
"spaced-comment": [
|
|
506
|
-
"warn",
|
|
507
|
-
"always",
|
|
508
|
-
{
|
|
509
|
-
markers: ["/"],
|
|
510
|
-
},
|
|
511
|
-
],
|
|
512
489
|
/** The `never` option is provided to make the rule stricter. */
|
|
513
490
|
strict: ["warn", "never"],
|
|
514
491
|
"symbol-description": "warn",
|
|
@@ -522,134 +499,6 @@ const SUGGESTIONS = {
|
|
|
522
499
|
const LAYOUT_AND_FORMATTING = {
|
|
523
500
|
"unicode-bom": "warn",
|
|
524
501
|
};
|
|
525
|
-
/**
|
|
526
|
-
* @see https://eslint.org/docs/latest/rules/#deprecated
|
|
527
|
-
* @type {Record<string, import("@typescript-eslint/utils").TSESLint.SharedConfig.RuleEntry>}
|
|
528
|
-
*/
|
|
529
|
-
const DEPRECATED = {
|
|
530
|
-
/** Disabled since the rule is deprecated. */
|
|
531
|
-
"array-bracket-newline": "off",
|
|
532
|
-
/** Disabled since the rule is deprecated. */
|
|
533
|
-
"array-bracket-spacing": "off",
|
|
534
|
-
/** Disabled since the rule is deprecated. */
|
|
535
|
-
"array-element-newline": "off",
|
|
536
|
-
/** Disabled since the rule is deprecated. */
|
|
537
|
-
"arrow-parens": "off",
|
|
538
|
-
/** Disabled since the rule is deprecated. */
|
|
539
|
-
"arrow-spacing": "off",
|
|
540
|
-
/** Disabled since the rule is deprecated. */
|
|
541
|
-
"block-spacing": "off",
|
|
542
|
-
/** Disabled since the rule is deprecated. */
|
|
543
|
-
"brace-style": "off",
|
|
544
|
-
/** Disabled since the rule is deprecated. */
|
|
545
|
-
"comma-dangle": "off",
|
|
546
|
-
/** Disabled since the rule is deprecated. */
|
|
547
|
-
"comma-spacing": "off",
|
|
548
|
-
/** Disabled since the rule is deprecated. */
|
|
549
|
-
"comma-style": "off",
|
|
550
|
-
/** Disabled since the rule is deprecated. */
|
|
551
|
-
"computed-property-spacing": "off",
|
|
552
|
-
/** Disabled since the rule is deprecated. */
|
|
553
|
-
"dot-location": "off",
|
|
554
|
-
/** Disabled since the rule is deprecated. */
|
|
555
|
-
"eol-last": "off",
|
|
556
|
-
/** Disabled since the rule is deprecated. */
|
|
557
|
-
"func-call-spacing": "off",
|
|
558
|
-
/** Disabled since the rule is deprecated. */
|
|
559
|
-
"function-call-argument-newline": "off",
|
|
560
|
-
/** Disabled since the rule is deprecated. */
|
|
561
|
-
"function-paren-newline": "off",
|
|
562
|
-
/** Disabled since the rule is deprecated. */
|
|
563
|
-
"generator-star-spacing": "off",
|
|
564
|
-
/** Disabled since the rule is deprecated. */
|
|
565
|
-
"implicit-arrow-linebreak": "off",
|
|
566
|
-
/** Disabled since the rule is deprecated. */
|
|
567
|
-
indent: "off",
|
|
568
|
-
/** Disabled since the rule is deprecated. */
|
|
569
|
-
"jsx-quotes": "off",
|
|
570
|
-
/** Disabled since the rule is deprecated. */
|
|
571
|
-
"key-spacing": "off",
|
|
572
|
-
/** Disabled since the rule is deprecated. */
|
|
573
|
-
"keyword-spacing": "off",
|
|
574
|
-
/** Disabled since the rule is deprecated. */
|
|
575
|
-
"line-comment-position": "off",
|
|
576
|
-
/** Disabled since the rule is deprecated. */
|
|
577
|
-
"linebreak-style": "off",
|
|
578
|
-
/** Disabled since the rule is deprecated. */
|
|
579
|
-
"lines-around-comment": "off",
|
|
580
|
-
/** Disabled since the rule is deprecated. */
|
|
581
|
-
"lines-between-class-members": "off",
|
|
582
|
-
/** Disabled since the rule is deprecated. */
|
|
583
|
-
"max-len": "off",
|
|
584
|
-
/** Disabled since the rule is deprecated. */
|
|
585
|
-
"max-statements-per-line": "off",
|
|
586
|
-
/** Disabled since the rule is deprecated. */
|
|
587
|
-
"multiline-ternary": "off",
|
|
588
|
-
/** Disabled since the rule is deprecated. */
|
|
589
|
-
"new-parens": "off",
|
|
590
|
-
/** Disabled since the rule is deprecated. */
|
|
591
|
-
"newline-per-chained-call": "off",
|
|
592
|
-
/** Disabled since the rule is deprecated. */
|
|
593
|
-
"no-extra-parens": "off",
|
|
594
|
-
/** Disabled since the rule is deprecated. */
|
|
595
|
-
"no-mixed-spaces-and-tabs": "off",
|
|
596
|
-
/** Disabled since the rule is deprecated. */
|
|
597
|
-
"no-multi-spaces": "off",
|
|
598
|
-
/** Disabled since the rule is deprecated. */
|
|
599
|
-
"no-multiple-empty-lines": "off",
|
|
600
|
-
/** Disabled since the rule is deprecated. */
|
|
601
|
-
"no-tabs": "off",
|
|
602
|
-
/** Disabled since the rule is deprecated. */
|
|
603
|
-
"no-trailing-spaces": "off",
|
|
604
|
-
/** Disabled since the rule is deprecated. */
|
|
605
|
-
"no-whitespace-before-property": "off",
|
|
606
|
-
/** Disabled since the rule is deprecated. */
|
|
607
|
-
"nonblock-statement-body-position": "off",
|
|
608
|
-
/** Disabled since the rule is deprecated. */
|
|
609
|
-
"object-curly-newline": "off",
|
|
610
|
-
/** Disabled since the rule is deprecated. */
|
|
611
|
-
"object-curly-spacing": "off",
|
|
612
|
-
/** Disabled since the rule is deprecated. */
|
|
613
|
-
"object-property-newline": "off",
|
|
614
|
-
/** Disabled since the rule is deprecated. */
|
|
615
|
-
"operator-linebreak": "off",
|
|
616
|
-
/** Disabled since the rule is deprecated. */
|
|
617
|
-
"padded-blocks": "off",
|
|
618
|
-
/** Disabled since the rule is deprecated. */
|
|
619
|
-
"padding-line-between-statements": "off",
|
|
620
|
-
/** Disabled since the rule is deprecated. */
|
|
621
|
-
quotes: "off",
|
|
622
|
-
/** Disabled since the rule is deprecated. */
|
|
623
|
-
"rest-spread-spacing": "off",
|
|
624
|
-
/** Disabled since the rule is deprecated. */
|
|
625
|
-
semi: "off",
|
|
626
|
-
/** Disabled since the rule is deprecated. */
|
|
627
|
-
"semi-spacing": "off",
|
|
628
|
-
/** Disabled since the rule is deprecated. */
|
|
629
|
-
"semi-style": "off",
|
|
630
|
-
/** Disabled since the rule is deprecated. */
|
|
631
|
-
"space-before-blocks": "off",
|
|
632
|
-
/** Disabled since the rule is deprecated. */
|
|
633
|
-
"space-before-function-paren": "off",
|
|
634
|
-
/** Disabled since the rule is deprecated. */
|
|
635
|
-
"space-in-parens": "off",
|
|
636
|
-
/** Disabled since the rule is deprecated. */
|
|
637
|
-
"space-infix-ops": "off",
|
|
638
|
-
/** Disabled since the rule is deprecated. */
|
|
639
|
-
"space-unary-ops": "off",
|
|
640
|
-
/** Disabled since the rule is deprecated. */
|
|
641
|
-
"switch-colon-spacing": "off",
|
|
642
|
-
/** Disabled since the rule is deprecated. */
|
|
643
|
-
"template-curly-spacing": "off",
|
|
644
|
-
/** Disabled since the rule is deprecated. */
|
|
645
|
-
"template-tag-spacing": "off",
|
|
646
|
-
/** Disabled since the rule is deprecated. */
|
|
647
|
-
"wrap-iife": "off",
|
|
648
|
-
/** Disabled since the rule is deprecated. */
|
|
649
|
-
"wrap-regex": "off",
|
|
650
|
-
/** Disabled since the rule is deprecated. */
|
|
651
|
-
"yield-star-spacing": "off",
|
|
652
|
-
};
|
|
653
502
|
/**
|
|
654
503
|
* This ESLint config only contains built-in rules from ESLint itself:
|
|
655
504
|
* https://eslint.org/docs/latest/rules/
|
|
@@ -658,13 +507,11 @@ const DEPRECATED = {
|
|
|
658
507
|
* 1) Possible Problems
|
|
659
508
|
* 2) Suggestions
|
|
660
509
|
* 3) Layout & Formatting
|
|
661
|
-
* 4) Deprecated
|
|
662
510
|
*/
|
|
663
511
|
export const baseESLint = tseslint.config({
|
|
664
512
|
rules: {
|
|
665
513
|
...POSSIBLE_PROBLEMS,
|
|
666
514
|
...SUGGESTIONS,
|
|
667
515
|
...LAYOUT_AND_FORMATTING,
|
|
668
|
-
...DEPRECATED,
|
|
669
516
|
},
|
|
670
517
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-jsdoc.d.ts","sourceRoot":"","sources":["../../src/base/base-jsdoc.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"base-jsdoc.d.ts","sourceRoot":"","sources":["../../src/base/base-jsdoc.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,4FAyQE"}
|
package/dist/base/base-jsdoc.js
CHANGED
|
@@ -84,8 +84,6 @@ export const baseJSDoc = tseslint.config({
|
|
|
84
84
|
"jsdoc/match-name": "off",
|
|
85
85
|
/** Superseded by the `complete/limit-jsdoc-comments` rule. */
|
|
86
86
|
"jsdoc/multiline-blocks": "off",
|
|
87
|
-
/** Superseded by the `complete/limit-jsdoc-comments` rule. */
|
|
88
|
-
"jsdoc/newline-after-description": "off",
|
|
89
87
|
/**
|
|
90
88
|
* Disabled because it provides little value; it only detects JSDoc comments with tags in
|
|
91
89
|
* them.
|
|
@@ -115,10 +113,10 @@ export const baseJSDoc = tseslint.config({
|
|
|
115
113
|
/** Disabled because it is not needed in TypeScript. */
|
|
116
114
|
"jsdoc/no-undefined-types": "off",
|
|
117
115
|
"jsdoc/require-asterisk-prefix": "warn",
|
|
118
|
-
/** Superseded by the `complete/jsdoc-complete-sentences` rule. */
|
|
119
|
-
"jsdoc/require-description-complete-sentence": "off",
|
|
120
116
|
/** Disabled because it is overboard for every function to have a description. */
|
|
121
117
|
"jsdoc/require-description": "off",
|
|
118
|
+
/** Superseded by the `complete/jsdoc-complete-sentences` rule. */
|
|
119
|
+
"jsdoc/require-description-complete-sentence": "off",
|
|
122
120
|
/** Disabled because it is overboard for every function to require an example. */
|
|
123
121
|
"jsdoc/require-example": "off",
|
|
124
122
|
/** Disabled because it is overboard for every file to require an overview. */
|
|
@@ -130,6 +128,18 @@ export const baseJSDoc = tseslint.config({
|
|
|
130
128
|
"jsdoc/require-hyphen-before-param-description": ["warn", "never"],
|
|
131
129
|
/** Disabled since it is overboard for every function to have a JSDoc comment. */
|
|
132
130
|
"jsdoc/require-jsdoc": "off",
|
|
131
|
+
/** Configured to only apply when there are one or more parameters. */
|
|
132
|
+
"jsdoc/require-param": [
|
|
133
|
+
"warn",
|
|
134
|
+
{
|
|
135
|
+
contexts: [
|
|
136
|
+
{
|
|
137
|
+
context: "FunctionDeclaration",
|
|
138
|
+
comment: 'JsdocBlock:has(JsdocTag[tag="param"])',
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
],
|
|
133
143
|
/** The `contexts` option is set to `any` to make the rule stricter. */
|
|
134
144
|
"jsdoc/require-param-description": [
|
|
135
145
|
"warn",
|
|
@@ -146,18 +156,6 @@ export const baseJSDoc = tseslint.config({
|
|
|
146
156
|
],
|
|
147
157
|
/** Disabled because it is not needed in TypeScript. */
|
|
148
158
|
"jsdoc/require-param-type": "off",
|
|
149
|
-
/** Configured to only apply when there are one or more parameters. */
|
|
150
|
-
"jsdoc/require-param": [
|
|
151
|
-
"warn",
|
|
152
|
-
{
|
|
153
|
-
contexts: [
|
|
154
|
-
{
|
|
155
|
-
context: "FunctionDeclaration",
|
|
156
|
-
comment: 'JsdocBlock:has(JsdocTag[tag="param"])',
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
},
|
|
160
|
-
],
|
|
161
159
|
/** Disabled because it is not needed in TypeScript. */
|
|
162
160
|
"jsdoc/require-property": "off",
|
|
163
161
|
"jsdoc/require-property-description": "warn",
|
|
@@ -165,6 +163,8 @@ export const baseJSDoc = tseslint.config({
|
|
|
165
163
|
/** Disabled because it is not needed in TypeScript. */
|
|
166
164
|
"jsdoc/require-property-type": "off",
|
|
167
165
|
/** Disabled because it is overboard for every function to document every return value. */
|
|
166
|
+
"jsdoc/require-returns": "off",
|
|
167
|
+
/** Disabled because it is overboard for every function to document every return value. */
|
|
168
168
|
"jsdoc/require-returns-check": "off",
|
|
169
169
|
/** The `contexts` option is set to `any` to make the rule stricter. */
|
|
170
170
|
"jsdoc/require-returns-description": [
|
|
@@ -175,8 +175,6 @@ export const baseJSDoc = tseslint.config({
|
|
|
175
175
|
],
|
|
176
176
|
/** Disabled because it is not needed in TypeScript. */
|
|
177
177
|
"jsdoc/require-returns-type": "off",
|
|
178
|
-
/** Disabled because it is overboard for every function to document every return value. */
|
|
179
|
-
"jsdoc/require-returns": "off",
|
|
180
178
|
/** Disabled because it is overboard to document every generic type variable. */
|
|
181
179
|
"jsdoc/require-template": "off",
|
|
182
180
|
/** Disabled because it is overboard to document every throw statement. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-n.d.ts","sourceRoot":"","sources":["../../src/base/base-n.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"base-n.d.ts","sourceRoot":"","sources":["../../src/base/base-n.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wFA0IE"}
|
package/dist/base/base-n.js
CHANGED
|
@@ -12,14 +12,14 @@ export const baseN = tseslint.config({
|
|
|
12
12
|
rules: {
|
|
13
13
|
/** Disabled since stylistic rules from this plugin are not used. */
|
|
14
14
|
"n/callback-return": "off",
|
|
15
|
+
/** Disabled since stylistic rules from this plugin are not used. */
|
|
16
|
+
"n/exports-style": "off",
|
|
15
17
|
/**
|
|
16
18
|
* This rule is helpful to automatically fix file extensions in import statements throughout
|
|
17
19
|
* an entire codebase.
|
|
18
20
|
*/
|
|
19
21
|
"n/file-extension-in-import": ["warn", "always"],
|
|
20
22
|
/** Disabled since stylistic rules from this plugin are not used. */
|
|
21
|
-
"n/exports-style": "off",
|
|
22
|
-
/** Disabled since stylistic rules from this plugin are not used. */
|
|
23
23
|
"n/global-require": "off",
|
|
24
24
|
"n/handle-callback-err": "warn",
|
|
25
25
|
/**
|
|
@@ -63,8 +63,6 @@ export const baseN = tseslint.config({
|
|
|
63
63
|
*/
|
|
64
64
|
"n/no-unpublished-import": "warn",
|
|
65
65
|
"n/no-unpublished-require": "warn",
|
|
66
|
-
/** Disabled because this rule is deprecated. */
|
|
67
|
-
"n/no-unsupported-features": "off",
|
|
68
66
|
/** Disabled because it is assumed that we are running on modern versions of Node.js. */
|
|
69
67
|
"n/no-unsupported-features/es-builtins": "off",
|
|
70
68
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-stylistic.d.ts","sourceRoot":"","sources":["../../src/base/base-stylistic.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"base-stylistic.d.ts","sourceRoot":"","sources":["../../src/base/base-stylistic.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,gGA8CG"}
|
|
@@ -23,6 +23,8 @@ export const baseStylistic = tseslint.config({
|
|
|
23
23
|
* `eslint-config-prettier`
|
|
24
24
|
* documentation](https://github.com/prettier/eslint-config-prettier#enforce-backticks).
|
|
25
25
|
*/
|
|
26
|
+
// The rule is currently bugged:
|
|
27
|
+
// https://github.com/eslint-stylistic/eslint-stylistic/issues/542
|
|
26
28
|
"@stylistic/quotes": [
|
|
27
29
|
"warn",
|
|
28
30
|
"double",
|
|
@@ -31,5 +33,18 @@ export const baseStylistic = tseslint.config({
|
|
|
31
33
|
allowTemplateLiterals: false,
|
|
32
34
|
},
|
|
33
35
|
],
|
|
36
|
+
/**
|
|
37
|
+
* Partially superseded by `complete/format-jsdoc-comments` and `complete/format-line-comments`,
|
|
38
|
+
* but those rules do not handle trailing line comments.
|
|
39
|
+
*
|
|
40
|
+
* The `markers` option is provided to make this rule ignore lines that start with "///".
|
|
41
|
+
*/
|
|
42
|
+
"@stylistic/spaced-comment": [
|
|
43
|
+
"warn",
|
|
44
|
+
"always",
|
|
45
|
+
{
|
|
46
|
+
markers: ["/"],
|
|
47
|
+
},
|
|
48
|
+
],
|
|
34
49
|
},
|
|
35
50
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-typescript-eslint.d.ts","sourceRoot":"","sources":["../../src/base/base-typescript-eslint.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"base-typescript-eslint.d.ts","sourceRoot":"","sources":["../../src/base/base-typescript-eslint.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,uGA4gBE"}
|
|
@@ -66,12 +66,17 @@ export const baseTypeScriptESLint = tseslint.config({
|
|
|
66
66
|
"@typescript-eslint/ban-ts-comment": "warn",
|
|
67
67
|
"@typescript-eslint/ban-tslint-comment": "warn",
|
|
68
68
|
"@typescript-eslint/class-literal-property-style": "warn",
|
|
69
|
+
"@typescript-eslint/class-methods-use-this": "warn",
|
|
69
70
|
"@typescript-eslint/consistent-generic-constructors": "warn",
|
|
70
71
|
"@typescript-eslint/consistent-indexed-object-style": "warn",
|
|
72
|
+
/** Disabled since this is handled by the `noImplicitReturns` TypeScript compiler flag. */
|
|
73
|
+
"@typescript-eslint/consistent-return": "off",
|
|
71
74
|
"@typescript-eslint/consistent-type-assertions": "warn",
|
|
72
75
|
"@typescript-eslint/consistent-type-definitions": "warn",
|
|
73
76
|
"@typescript-eslint/consistent-type-exports": "warn",
|
|
74
77
|
"@typescript-eslint/consistent-type-imports": "warn",
|
|
78
|
+
"@typescript-eslint/default-param-last": "warn",
|
|
79
|
+
"@typescript-eslint/dot-notation": "warn",
|
|
75
80
|
/**
|
|
76
81
|
* Disabled since it would be to cumbersome to require return types for non-exported
|
|
77
82
|
* functions. (It is more reasonable to require it for exported functions only, since it
|
|
@@ -84,13 +89,17 @@ export const baseTypeScriptESLint = tseslint.config({
|
|
|
84
89
|
*/
|
|
85
90
|
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
86
91
|
"@typescript-eslint/explicit-module-boundary-types": "warn",
|
|
92
|
+
/**
|
|
93
|
+
* Disabled since it is superfluous to require an `= undefined` during variable initialization
|
|
94
|
+
* (and TypeScript will take care of the non-undefined cases).
|
|
95
|
+
*/
|
|
96
|
+
"@typescript-eslint/init-declarations": "off",
|
|
87
97
|
/**
|
|
88
98
|
* Disabled because enforcing an arbitrary parameter number threshold for every function in a
|
|
89
99
|
* project does not provide much value. (Additionally, using TypeScript reduces the value of
|
|
90
100
|
* such a check.)
|
|
91
101
|
*/
|
|
92
102
|
"@typescript-eslint/max-params": "off",
|
|
93
|
-
"@typescript-eslint/member-delimiter-style": "off", // eslint-config-prettier
|
|
94
103
|
/** Disabled since prescribed class ordering is too project-specific. */
|
|
95
104
|
"@typescript-eslint/member-ordering": "off",
|
|
96
105
|
"@typescript-eslint/method-signature-style": "warn",
|
|
@@ -124,13 +133,21 @@ export const baseTypeScriptESLint = tseslint.config({
|
|
|
124
133
|
leadingUnderscore: "allow",
|
|
125
134
|
},
|
|
126
135
|
],
|
|
136
|
+
"@typescript-eslint/no-array-constructor": "warn",
|
|
137
|
+
"@typescript-eslint/no-array-delete": "warn",
|
|
127
138
|
"@typescript-eslint/no-base-to-string": "warn",
|
|
128
139
|
"@typescript-eslint/no-confusing-non-null-assertion": "warn",
|
|
129
140
|
"@typescript-eslint/no-confusing-void-expression": "warn",
|
|
130
141
|
"@typescript-eslint/no-deprecated": "warn",
|
|
142
|
+
/**
|
|
143
|
+
* Disabled since it is superfluous when using TypeScript according to [the ESLint
|
|
144
|
+
* documentation](https://eslint.org/docs/latest/rules/no-dupe-class-members#when-not-to-use-it).
|
|
145
|
+
*/
|
|
146
|
+
"@typescript-eslint/no-dupe-class-members": "off",
|
|
131
147
|
"@typescript-eslint/no-duplicate-enum-values": "warn",
|
|
132
148
|
"@typescript-eslint/no-duplicate-type-constituents": "warn",
|
|
133
149
|
"@typescript-eslint/no-dynamic-delete": "warn",
|
|
150
|
+
"@typescript-eslint/no-empty-function": "warn",
|
|
134
151
|
/**
|
|
135
152
|
* The `allowSingleExtends` option is enabled to allow for the common pattern of using using
|
|
136
153
|
* interfaces to provide an opaque type. (This can be useful with type-builders such as Zod,
|
|
@@ -159,9 +176,21 @@ export const baseTypeScriptESLint = tseslint.config({
|
|
|
159
176
|
},
|
|
160
177
|
],
|
|
161
178
|
"@typescript-eslint/no-for-in-array": "warn",
|
|
179
|
+
"@typescript-eslint/no-implied-eval": "warn",
|
|
162
180
|
"@typescript-eslint/no-import-type-side-effects": "warn",
|
|
163
181
|
"@typescript-eslint/no-inferrable-types": "warn",
|
|
182
|
+
/** The `capIsConstructor` option is disabled to make the rule stricter. */
|
|
183
|
+
"@typescript-eslint/no-invalid-this": [
|
|
184
|
+
"warn",
|
|
185
|
+
{
|
|
186
|
+
capIsConstructor: false,
|
|
187
|
+
},
|
|
188
|
+
],
|
|
164
189
|
"@typescript-eslint/no-invalid-void-type": "warn",
|
|
190
|
+
"@typescript-eslint/no-loop-func": "warn",
|
|
191
|
+
"@typescript-eslint/no-loss-of-precision": "warn",
|
|
192
|
+
/** Disabled since it results in too many false positives. */
|
|
193
|
+
"@typescript-eslint/no-magic-numbers": "off",
|
|
165
194
|
"@typescript-eslint/no-meaningless-void-operator": "warn",
|
|
166
195
|
"@typescript-eslint/no-misused-new": "warn",
|
|
167
196
|
"@typescript-eslint/no-misused-promises": "warn",
|
|
@@ -170,10 +199,59 @@ export const baseTypeScriptESLint = tseslint.config({
|
|
|
170
199
|
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "warn",
|
|
171
200
|
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
|
|
172
201
|
"@typescript-eslint/no-non-null-assertion": "warn",
|
|
202
|
+
/**
|
|
203
|
+
* Disabled since it is handled by the combination of the TypeScript compiler and the `no-var`
|
|
204
|
+
* ESLint rule.
|
|
205
|
+
*/
|
|
206
|
+
"@typescript-eslint/no-redeclare": "off",
|
|
173
207
|
"@typescript-eslint/no-redundant-type-constituents": "warn",
|
|
174
208
|
"@typescript-eslint/no-require-imports": "warn",
|
|
209
|
+
/**
|
|
210
|
+
* Configured to prevent importing with some common patterns that are almost always a mistake:
|
|
211
|
+
*
|
|
212
|
+
* - "src" directories (but allowed in test files that are in a separate "tests" directory)
|
|
213
|
+
* - "dist" directories
|
|
214
|
+
* - "index" files (things in the same package should directly import instead of use the
|
|
215
|
+
* public API)
|
|
216
|
+
*/
|
|
217
|
+
"@typescript-eslint/no-restricted-imports": [
|
|
218
|
+
"warn",
|
|
219
|
+
{
|
|
220
|
+
patterns: [
|
|
221
|
+
// Some "src" directories have an "index.ts" file, which means that importing from the
|
|
222
|
+
// directory is valid. Thus, we check for the "src" directory with no suffix.
|
|
223
|
+
{
|
|
224
|
+
group: ["**/src"],
|
|
225
|
+
message: 'You cannot import from a "src" directory. If this is a monorepo, import using the package name like you would in a non-monorepo project.',
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
group: ["**/src/**"],
|
|
229
|
+
message: 'You cannot import from a "src" directory. If this is a monorepo, import using the package name like you would in a non-monorepo project.',
|
|
230
|
+
},
|
|
231
|
+
// Some "dist" directories have an "index.ts" file, which means that importing from the
|
|
232
|
+
// directory is valid. Thus, we check for the "dist" directory with no suffix.
|
|
233
|
+
{
|
|
234
|
+
group: ["**/dist"],
|
|
235
|
+
message: 'You cannot import from a "dist" directory. If this is a monorepo, import using the package name like you would in a non-monorepo project.',
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
group: ["**/dist/**"],
|
|
239
|
+
message: 'You cannot import from a "dist" directory. If this is a monorepo, import using the package name like you would in a non-monorepo project.',
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
group: ["**/index"],
|
|
243
|
+
message: "You cannot import from a package index. Instead, import directly from the file where the code is located.",
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
group: ["**/index.{js,cjs,mjs,ts,cts,mts}"],
|
|
247
|
+
message: "You cannot import from a package index. Instead, import directly from the file where the code is located.",
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
],
|
|
175
252
|
/** Disabled since this rule is intended to be used for project-specific types. */
|
|
176
253
|
"@typescript-eslint/no-restricted-types": "off",
|
|
254
|
+
"@typescript-eslint/no-shadow": "warn",
|
|
177
255
|
"@typescript-eslint/no-this-alias": "warn",
|
|
178
256
|
/** Disabled because this rule is deprecated. */
|
|
179
257
|
"@typescript-eslint/no-type-alias": "off",
|
|
@@ -195,6 +273,32 @@ export const baseTypeScriptESLint = tseslint.config({
|
|
|
195
273
|
"@typescript-eslint/no-unsafe-member-access": "warn",
|
|
196
274
|
"@typescript-eslint/no-unsafe-return": "warn",
|
|
197
275
|
"@typescript-eslint/no-unsafe-unary-minus": "warn",
|
|
276
|
+
/**
|
|
277
|
+
* The `allowTaggedTemplates` option is enabled to allow the rule to work with libraries like
|
|
278
|
+
* `execa`.
|
|
279
|
+
*/
|
|
280
|
+
"@typescript-eslint/no-unused-expressions": [
|
|
281
|
+
"warn",
|
|
282
|
+
{
|
|
283
|
+
allowTaggedTemplates: true,
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
/**
|
|
287
|
+
* The `args` option is set to `all` make the rule stricter. Additionally, we ignore things
|
|
288
|
+
* that begin with an underscore, since this matches the behavior of the `--noUnusedLocals`
|
|
289
|
+
* TypeScript compiler flag.
|
|
290
|
+
*/
|
|
291
|
+
"@typescript-eslint/no-unused-vars": [
|
|
292
|
+
"warn",
|
|
293
|
+
{
|
|
294
|
+
args: "all", // "after-used" is the default.
|
|
295
|
+
argsIgnorePattern: "^_",
|
|
296
|
+
varsIgnorePattern: "^_",
|
|
297
|
+
},
|
|
298
|
+
],
|
|
299
|
+
/** Disabled because it can prevent code from being structured sequentially. */
|
|
300
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
301
|
+
"@typescript-eslint/no-useless-constructor": "warn",
|
|
198
302
|
"@typescript-eslint/no-useless-empty-export": "warn",
|
|
199
303
|
"@typescript-eslint/no-var-requires": "warn",
|
|
200
304
|
"@typescript-eslint/no-wrapper-object-types": "warn",
|
|
@@ -238,6 +342,13 @@ export const baseTypeScriptESLint = tseslint.config({
|
|
|
238
342
|
* circumstances](https://github.com/typescript-eslint/typescript-eslint/issues/5269).
|
|
239
343
|
*/
|
|
240
344
|
"@typescript-eslint/prefer-optional-chain": "off",
|
|
345
|
+
/** The `allowEmptyReject` option is enabled since this is a common pattern. */
|
|
346
|
+
"@typescript-eslint/prefer-promise-reject-errors": [
|
|
347
|
+
"warn",
|
|
348
|
+
{
|
|
349
|
+
allowEmptyReject: true,
|
|
350
|
+
},
|
|
351
|
+
],
|
|
241
352
|
"@typescript-eslint/prefer-readonly": "warn",
|
|
242
353
|
/** Superseded by the `complete/prefer-readonly-parameter-types` rule. */
|
|
243
354
|
"@typescript-eslint/prefer-readonly-parameter-types": "off",
|
|
@@ -249,6 +360,7 @@ export const baseTypeScriptESLint = tseslint.config({
|
|
|
249
360
|
"@typescript-eslint/prefer-ts-expect-error": "warn",
|
|
250
361
|
"@typescript-eslint/promise-function-async": "warn",
|
|
251
362
|
"@typescript-eslint/require-array-sort-compare": "warn",
|
|
363
|
+
"@typescript-eslint/require-await": "warn",
|
|
252
364
|
/** The various "allow" options are disabled to make the rule stricter. */
|
|
253
365
|
"@typescript-eslint/restrict-plus-operands": [
|
|
254
366
|
"warn",
|
|
@@ -264,6 +376,11 @@ export const baseTypeScriptESLint = tseslint.config({
|
|
|
264
376
|
* Disabled since a common use-case of template strings is to coerce everything to a string.
|
|
265
377
|
*/
|
|
266
378
|
"@typescript-eslint/restrict-template-expressions": "off",
|
|
379
|
+
/**
|
|
380
|
+
* Even though the core rule was deprecated, the extended rule uses type information, so it is
|
|
381
|
+
* much better.
|
|
382
|
+
*/
|
|
383
|
+
"@typescript-eslint/return-await": "warn",
|
|
267
384
|
/** Disabled since in it does not make sense to sort a union alphabetically in many cases. */
|
|
268
385
|
"@typescript-eslint/sort-type-constituents": "off",
|
|
269
386
|
/** The `allowString` and `allowNumber` options are disabled to make the rule stricter. */
|
|
@@ -293,7 +410,6 @@ export const baseTypeScriptESLint = tseslint.config({
|
|
|
293
410
|
},
|
|
294
411
|
],
|
|
295
412
|
"@typescript-eslint/triple-slash-reference": "warn",
|
|
296
|
-
"@typescript-eslint/type-annotation-spacing": "off", // eslint-config-prettier
|
|
297
413
|
/**
|
|
298
414
|
* Disabled since it is not recommended by the `typescript-eslint` team. (They recommend using
|
|
299
415
|
* the `noImplicitAny` and `strictPropertyInitialization` TypeScript compiler options
|
|
@@ -303,144 +419,6 @@ export const baseTypeScriptESLint = tseslint.config({
|
|
|
303
419
|
"@typescript-eslint/unbound-method": "warn",
|
|
304
420
|
"@typescript-eslint/unified-signatures": "warn",
|
|
305
421
|
"@typescript-eslint/use-unknown-in-catch-callback-variable": "warn",
|
|
306
|
-
"@typescript-eslint/block-spacing": "off", // eslint-config-prettier
|
|
307
|
-
"@typescript-eslint/brace-style": "off", // eslint-config-prettier
|
|
308
|
-
"@typescript-eslint/class-methods-use-this": "warn",
|
|
309
|
-
"@typescript-eslint/comma-dangle": "off", // eslint-config-prettier
|
|
310
|
-
"@typescript-eslint/comma-spacing": "off", // eslint-config-prettier
|
|
311
|
-
/** Disabled since this is handled by the `noImplicitReturns` TypeScript compiler flag. */
|
|
312
|
-
"@typescript-eslint/consistent-return": "off",
|
|
313
|
-
"@typescript-eslint/default-param-last": "warn",
|
|
314
|
-
"@typescript-eslint/dot-notation": "warn",
|
|
315
|
-
"@typescript-eslint/func-call-spacing": "off", // eslint-config-prettier
|
|
316
|
-
"@typescript-eslint/indent": "off", // eslint-config-prettier
|
|
317
|
-
/**
|
|
318
|
-
* Disabled since it is superfluous to require an `= undefined` during variable initialization
|
|
319
|
-
* (and TypeScript will take care of the non-undefined cases).
|
|
320
|
-
*/
|
|
321
|
-
"@typescript-eslint/init-declarations": "off",
|
|
322
|
-
"@typescript-eslint/key-spacing": "off", // eslint-config-prettier
|
|
323
|
-
"@typescript-eslint/keyword-spacing": "off", // eslint-config-prettier
|
|
324
|
-
"@typescript-eslint/no-array-constructor": "warn",
|
|
325
|
-
"@typescript-eslint/no-array-delete": "warn",
|
|
326
|
-
/**
|
|
327
|
-
* Disabled since it is superfluous when using TypeScript according to [the ESLint
|
|
328
|
-
* documentation](https://eslint.org/docs/latest/rules/no-dupe-class-members#when-not-to-use-it).
|
|
329
|
-
*/
|
|
330
|
-
"@typescript-eslint/no-dupe-class-members": "off",
|
|
331
|
-
"@typescript-eslint/no-empty-function": "warn",
|
|
332
|
-
"@typescript-eslint/no-extra-parens": "off", // eslint-config-prettier
|
|
333
|
-
"@typescript-eslint/no-extra-semi": "off", // eslint-config-prettier
|
|
334
|
-
"@typescript-eslint/no-implied-eval": "warn",
|
|
335
|
-
/** The `capIsConstructor` option is disabled to make the rule stricter. */
|
|
336
|
-
"@typescript-eslint/no-invalid-this": [
|
|
337
|
-
"warn",
|
|
338
|
-
{
|
|
339
|
-
capIsConstructor: false,
|
|
340
|
-
},
|
|
341
|
-
],
|
|
342
|
-
"@typescript-eslint/no-loop-func": "warn",
|
|
343
|
-
"@typescript-eslint/no-loss-of-precision": "warn",
|
|
344
|
-
/** Disabled since it results in too many false positives. */
|
|
345
|
-
"@typescript-eslint/no-magic-numbers": "off",
|
|
346
|
-
/**
|
|
347
|
-
* Disabled since it is handled by the combination of the TypeScript compiler and the `no-var`
|
|
348
|
-
* ESLint rule.
|
|
349
|
-
*/
|
|
350
|
-
"@typescript-eslint/no-redeclare": "off",
|
|
351
|
-
/**
|
|
352
|
-
* Configured to prevent importing with some common patterns that are almost always a mistake:
|
|
353
|
-
*
|
|
354
|
-
* - "src" directories (but allowed in test files that are in a separate "tests" directory)
|
|
355
|
-
* - "dist" directories
|
|
356
|
-
* - "index" files (things in the same package should directly import instead of use the
|
|
357
|
-
* public API)
|
|
358
|
-
*/
|
|
359
|
-
"@typescript-eslint/no-restricted-imports": [
|
|
360
|
-
"warn",
|
|
361
|
-
{
|
|
362
|
-
patterns: [
|
|
363
|
-
// Some "src" directories have an "index.ts" file, which means that importing from the
|
|
364
|
-
// directory is valid. Thus, we check for the "src" directory with no suffix.
|
|
365
|
-
{
|
|
366
|
-
group: ["**/src"],
|
|
367
|
-
message: 'You cannot import from a "src" directory. If this is a monorepo, import using the package name like you would in a non-monorepo project.',
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
group: ["**/src/**"],
|
|
371
|
-
message: 'You cannot import from a "src" directory. If this is a monorepo, import using the package name like you would in a non-monorepo project.',
|
|
372
|
-
},
|
|
373
|
-
// Some "dist" directories have an "index.ts" file, which means that importing from the
|
|
374
|
-
// directory is valid. Thus, we check for the "dist" directory with no suffix.
|
|
375
|
-
{
|
|
376
|
-
group: ["**/dist"],
|
|
377
|
-
message: 'You cannot import from a "dist" directory. If this is a monorepo, import using the package name like you would in a non-monorepo project.',
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
group: ["**/dist/**"],
|
|
381
|
-
message: 'You cannot import from a "dist" directory. If this is a monorepo, import using the package name like you would in a non-monorepo project.',
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
group: ["**/index"],
|
|
385
|
-
message: "You cannot import from a package index. Instead, import directly from the file where the code is located.",
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
group: ["**/index.{js,cjs,mjs,ts,cts,mts}"],
|
|
389
|
-
message: "You cannot import from a package index. Instead, import directly from the file where the code is located.",
|
|
390
|
-
},
|
|
391
|
-
],
|
|
392
|
-
},
|
|
393
|
-
],
|
|
394
|
-
"@typescript-eslint/no-shadow": "warn",
|
|
395
|
-
/**
|
|
396
|
-
* The `allowTaggedTemplates` option is enabled to allow the rule to work with libraries like
|
|
397
|
-
* `execa`.
|
|
398
|
-
*/
|
|
399
|
-
"@typescript-eslint/no-unused-expressions": [
|
|
400
|
-
"warn",
|
|
401
|
-
{
|
|
402
|
-
allowTaggedTemplates: true,
|
|
403
|
-
},
|
|
404
|
-
],
|
|
405
|
-
/**
|
|
406
|
-
* The `args` option is set to `all` make the rule stricter. Additionally, we ignore things
|
|
407
|
-
* that begin with an underscore, since this matches the behavior of the `--noUnusedLocals`
|
|
408
|
-
* TypeScript compiler flag.
|
|
409
|
-
*/
|
|
410
|
-
"@typescript-eslint/no-unused-vars": [
|
|
411
|
-
"warn",
|
|
412
|
-
{
|
|
413
|
-
args: "all", // "after-used" is the default.
|
|
414
|
-
argsIgnorePattern: "^_",
|
|
415
|
-
varsIgnorePattern: "^_",
|
|
416
|
-
},
|
|
417
|
-
],
|
|
418
|
-
/** Disabled because it can prevent code from being structured sequentially. */
|
|
419
|
-
"@typescript-eslint/no-use-before-define": "off",
|
|
420
|
-
"@typescript-eslint/no-useless-constructor": "warn",
|
|
421
|
-
"@typescript-eslint/object-curly-spacing": "off", // eslint-config-prettier
|
|
422
|
-
/**
|
|
423
|
-
* Disabled since it is for inserting extra newlines between specific kinds of statements,
|
|
424
|
-
* which would be project-dependant. (This kind of formatting is not handled by Prettier.)
|
|
425
|
-
*/
|
|
426
|
-
"@typescript-eslint/padding-line-between-statements": "off",
|
|
427
|
-
/** The `allowEmptyReject` option is enabled since this is a common pattern. */
|
|
428
|
-
"@typescript-eslint/prefer-promise-reject-errors": [
|
|
429
|
-
"warn",
|
|
430
|
-
{
|
|
431
|
-
allowEmptyReject: true,
|
|
432
|
-
},
|
|
433
|
-
],
|
|
434
|
-
"@typescript-eslint/require-await": "warn",
|
|
435
|
-
/**
|
|
436
|
-
* Even though the core rule was deprecated, the extended rule uses type information, so it is
|
|
437
|
-
* much better.
|
|
438
|
-
*/
|
|
439
|
-
"@typescript-eslint/return-await": "warn",
|
|
440
|
-
"@typescript-eslint/semi": "off", // eslint-config-prettier
|
|
441
|
-
"@typescript-eslint/space-before-blocks": "off", // eslint-config-prettier
|
|
442
|
-
"@typescript-eslint/space-before-function-paren": "off", // eslint-config-prettier
|
|
443
|
-
"@typescript-eslint/space-infix-ops": "off", // eslint-config-prettier
|
|
444
422
|
},
|
|
445
423
|
},
|
|
446
424
|
// Enable linting on TypeScript file extensions.
|
|
@@ -451,6 +429,7 @@ export const baseTypeScriptESLint = tseslint.config({
|
|
|
451
429
|
{
|
|
452
430
|
files: ["**/*.js", "**/*.cjs", "**/*.mjs", "**/*.jsx"],
|
|
453
431
|
rules: {
|
|
432
|
+
"@typescript-eslint/consistent-type-imports": "off",
|
|
454
433
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
455
434
|
"@typescript-eslint/no-require-imports": "off",
|
|
456
435
|
"@typescript-eslint/no-unsafe-argument": "off",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-unicorn.d.ts","sourceRoot":"","sources":["../../src/base/base-unicorn.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-unicorn.d.ts","sourceRoot":"","sources":["../../src/base/base-unicorn.js"],"names":[],"mappings":"AAyOA;;;;;;;GAOG;AACH,8FASG"}
|
|
@@ -140,6 +140,9 @@ const NORMAL_RULES = {
|
|
|
140
140
|
/** Disabled since string content enforcement is too project-specific. */
|
|
141
141
|
"unicorn/string-content": "off",
|
|
142
142
|
"unicorn/switch-case-braces": "warn",
|
|
143
|
+
/**
|
|
144
|
+
* Even though this rule is in `eslint-config-prettier`, it is not actually handled by Prettier.
|
|
145
|
+
*/
|
|
143
146
|
"unicorn/template-indent": "warn",
|
|
144
147
|
"unicorn/text-encoding-identifier-case": "warn",
|
|
145
148
|
"unicorn/throw-new-error": "warn",
|
package/dist/base.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,qGA0BE"}
|
package/dist/base.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ESLintPluginComplete from "eslint-plugin-complete";
|
|
2
1
|
import tseslint from "typescript-eslint";
|
|
2
|
+
import { baseComplete } from "./base/base-complete.js";
|
|
3
3
|
import { baseESLint } from "./base/base-eslint.js";
|
|
4
4
|
import { baseImportX } from "./base/base-import-x.js";
|
|
5
5
|
import { baseJSDoc } from "./base/base-jsdoc.js";
|
|
@@ -7,16 +7,6 @@ import { baseN } from "./base/base-n.js";
|
|
|
7
7
|
import { baseStylistic } from "./base/base-stylistic.js";
|
|
8
8
|
import { baseTypeScriptESLint } from "./base/base-typescript-eslint.js";
|
|
9
9
|
import { baseUnicorn } from "./base/base-unicorn.js";
|
|
10
|
-
// Hot-patch "eslint-plugin-complete" to convert errors to warnings.
|
|
11
|
-
for (const config of ESLintPluginComplete.configs.recommended) {
|
|
12
|
-
if (config.rules !== undefined) {
|
|
13
|
-
for (const [key, value] of Object.entries(config.rules)) {
|
|
14
|
-
if (value === "error") {
|
|
15
|
-
config.rules[key] = "warn";
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
10
|
/**
|
|
21
11
|
* This ESLint config is meant to be used as a base for all TypeScript projects.
|
|
22
12
|
*
|
|
@@ -24,10 +14,7 @@ for (const config of ESLintPluginComplete.configs.recommended) {
|
|
|
24
14
|
* originating plugin) .
|
|
25
15
|
*/
|
|
26
16
|
export const completeConfigBase = tseslint.config(...baseESLint, ...baseTypeScriptESLint, ...baseStylistic, ...baseImportX, ...baseJSDoc, ...baseN, // "n" stands for Node.
|
|
27
|
-
...baseUnicorn,
|
|
28
|
-
// `eslint-plugin-complete` provides extra miscellaneous rules to keep code safe:
|
|
29
|
-
// https://github.com/complete-ts/complete/tree/main/packages/eslint-plugin-complete
|
|
30
|
-
...ESLintPluginComplete.configs.recommended,
|
|
17
|
+
...baseUnicorn, ...baseComplete,
|
|
31
18
|
// We prefer the official `reportUnusedDisableDirectives` linter option over the 3rd-party plugin
|
|
32
19
|
// of "eslint-plugin-eslint-comments".
|
|
33
20
|
{
|
|
@@ -38,7 +25,7 @@ export const completeConfigBase = tseslint.config(...baseESLint, ...baseTypeScri
|
|
|
38
25
|
// By default, ESLint ignores "**/node_modules/" and ".git/":
|
|
39
26
|
// https://eslint.org/docs/latest/use/configure/ignore#ignoring-files
|
|
40
27
|
// We also ignore want to ignore:
|
|
41
|
-
// - The "dist" directory since it is the idiomatic place for compiled output in TypeScript.
|
|
42
|
-
// - Minified files.
|
|
28
|
+
// - The "dist" directory, since it is the idiomatic place for compiled output in TypeScript.
|
|
29
|
+
// - Minified JavaScript files.
|
|
43
30
|
ignores: ["**/dist/", "*.min.js"],
|
|
44
31
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-complete",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "A sharable ESLint config for TypeScript projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
"linting",
|
|
11
11
|
"prettier"
|
|
12
12
|
],
|
|
13
|
-
"homepage": "https://complete-
|
|
13
|
+
"homepage": "https://complete-ts.github.io/",
|
|
14
14
|
"bugs": {
|
|
15
|
-
"url": "https://github.com/complete-
|
|
15
|
+
"url": "https://github.com/complete-ts/complete/issues"
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/complete-
|
|
19
|
+
"url": "git+https://github.com/complete-ts/complete.git"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"author": "Zamiell",
|
|
@@ -38,21 +38,21 @@
|
|
|
38
38
|
"@stylistic/eslint-plugin": "^2.8.0",
|
|
39
39
|
"confusing-browser-globals": "^1.0.11",
|
|
40
40
|
"eslint-import-resolver-typescript": "^3.6.3",
|
|
41
|
-
"eslint-plugin-complete": "^1.0.
|
|
41
|
+
"eslint-plugin-complete": "^1.0.2",
|
|
42
42
|
"eslint-plugin-import-x": "^4.2.1",
|
|
43
|
-
"eslint-plugin-jsdoc": "^50.2.
|
|
44
|
-
"eslint-plugin-n": "^17.10.
|
|
43
|
+
"eslint-plugin-jsdoc": "^50.2.4",
|
|
44
|
+
"eslint-plugin-n": "^17.10.3",
|
|
45
45
|
"eslint-plugin-unicorn": "^55.0.0",
|
|
46
|
-
"typescript-eslint": "^8.
|
|
46
|
+
"typescript-eslint": "^8.6.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@eslint/js": "^9.10.0",
|
|
50
50
|
"@types/confusing-browser-globals": "^1.0.3",
|
|
51
51
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
52
52
|
"@types/eslint__js": "^8.42.3",
|
|
53
|
-
"@types/node": "^22.5.
|
|
53
|
+
"@types/node": "^22.5.5",
|
|
54
54
|
"complete-common": "^1.0.0",
|
|
55
|
-
"complete-node": "^1.
|
|
55
|
+
"complete-node": "^1.5.1",
|
|
56
56
|
"eslint-config-prettier": "^9.1.0",
|
|
57
57
|
"extract-comments": "^1.1.0",
|
|
58
58
|
"typescript": "5.5.4"
|