@typescript-eslint/eslint-plugin 6.20.1-alpha.17 → 6.20.1-alpha.18

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.
@@ -114,15 +114,15 @@ Example configuration:
114
114
  // add a custom message, AND tell the plugin how to fix it
115
115
  "OldAPI": {
116
116
  "message": "Use NewAPI instead",
117
- "fixWith": "NewAPI"
117
+ "fixWith": "NewAPI",
118
118
  },
119
119
 
120
120
  // un-ban a type that's banned by default
121
- "{}": false
121
+ "{}": false,
122
122
  },
123
- "extendDefaults": true
124
- }
125
- ]
123
+ "extendDefaults": true,
124
+ },
125
+ ],
126
126
  }
127
127
  ```
128
128
 
@@ -76,17 +76,17 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e.
76
76
  {
77
77
  "rules": {
78
78
  // disable the rule for all files
79
- "@typescript-eslint/explicit-function-return-type": "off"
79
+ "@typescript-eslint/explicit-function-return-type": "off",
80
80
  },
81
81
  "overrides": [
82
82
  {
83
83
  // enable the rule specifically for TypeScript files
84
84
  "files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
85
85
  "rules": {
86
- "@typescript-eslint/explicit-function-return-type": "error"
87
- }
88
- }
89
- ]
86
+ "@typescript-eslint/explicit-function-return-type": "error",
87
+ },
88
+ },
89
+ ],
90
90
  }
91
91
  ```
92
92
 
@@ -30,17 +30,17 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e.
30
30
  {
31
31
  "rules": {
32
32
  // disable the rule for all files
33
- "@typescript-eslint/explicit-member-accessibility": "off"
33
+ "@typescript-eslint/explicit-member-accessibility": "off",
34
34
  },
35
35
  "overrides": [
36
36
  {
37
37
  // enable the rule specifically for TypeScript files
38
38
  "files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
39
39
  "rules": {
40
- "@typescript-eslint/explicit-member-accessibility": "error"
41
- }
42
- }
43
- ]
40
+ "@typescript-eslint/explicit-member-accessibility": "error",
41
+ },
42
+ },
43
+ ],
44
44
  }
45
45
  ```
46
46
 
@@ -75,17 +75,17 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e.
75
75
  {
76
76
  "rules": {
77
77
  // disable the rule for all files
78
- "@typescript-eslint/explicit-module-boundary-types": "off"
78
+ "@typescript-eslint/explicit-module-boundary-types": "off",
79
79
  },
80
80
  "overrides": [
81
81
  {
82
82
  // enable the rule specifically for TypeScript files
83
83
  "files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
84
84
  "rules": {
85
- "@typescript-eslint/explicit-module-boundary-types": "error"
86
- }
87
- }
88
- ]
85
+ "@typescript-eslint/explicit-module-boundary-types": "error",
86
+ },
87
+ },
88
+ ],
89
89
  }
90
90
  ```
91
91
 
@@ -249,9 +249,9 @@ The default configuration looks as follows:
249
249
 
250
250
  "decorated-method",
251
251
 
252
- "method"
253
- ]
254
- }
252
+ "method",
253
+ ],
254
+ },
255
255
  }
256
256
  ```
257
257
 
@@ -279,9 +279,9 @@ It also ignores accessibility and scope.
279
279
  "rules": {
280
280
  "@typescript-eslint/member-ordering": [
281
281
  "error",
282
- { "default": ["signature", "method", "constructor", "field"] }
283
- ]
284
- }
282
+ { "default": ["signature", "method", "constructor", "field"] },
283
+ ],
284
+ },
285
285
  }
286
286
  ```
287
287
 
@@ -414,9 +414,9 @@ It doesn't apply to interfaces or type literals as accessibility and scope are n
414
414
  "rules": {
415
415
  "@typescript-eslint/member-ordering": [
416
416
  "error",
417
- { "default": ["public-instance-method", "public-static-field"] }
418
- ]
419
- }
417
+ { "default": ["public-instance-method", "public-static-field"] },
418
+ ],
419
+ },
420
420
  }
421
421
  ```
422
422
 
@@ -508,9 +508,9 @@ It doesn't apply to interfaces or type literals as accessibility and scope are n
508
508
  "rules": {
509
509
  "@typescript-eslint/member-ordering": [
510
510
  "error",
511
- { "default": ["public-static-field", "static-field", "instance-field"] }
512
- ]
513
- }
511
+ { "default": ["public-static-field", "static-field", "instance-field"] },
512
+ ],
513
+ },
514
514
  }
515
515
  ```
516
516
 
@@ -597,9 +597,9 @@ Default settings will be used for class declarations and all other syntax constr
597
597
  "rules": {
598
598
  "@typescript-eslint/member-ordering": [
599
599
  "error",
600
- { "classes": ["method", "constructor", "field"] }
601
- ]
602
- }
600
+ { "classes": ["method", "constructor", "field"] },
601
+ ],
602
+ },
603
603
  }
604
604
  ```
605
605
 
@@ -647,9 +647,9 @@ Default settings will be used for class declarations and all other syntax constr
647
647
  "rules": {
648
648
  "@typescript-eslint/member-ordering": [
649
649
  "error",
650
- { "classExpressions": ["method", "constructor", "field"] }
651
- ]
652
- }
650
+ { "classExpressions": ["method", "constructor", "field"] },
651
+ ],
652
+ },
653
653
  }
654
654
  ```
655
655
 
@@ -701,9 +701,9 @@ These member types are the only ones allowed for `interfaces`.
701
701
  "rules": {
702
702
  "@typescript-eslint/member-ordering": [
703
703
  "error",
704
- { "interfaces": ["signature", "method", "constructor", "field"] }
705
- ]
706
- }
704
+ { "interfaces": ["signature", "method", "constructor", "field"] },
705
+ ],
706
+ },
707
707
  }
708
708
  ```
709
709
 
@@ -753,9 +753,9 @@ These member types are the only ones allowed for `typeLiterals`.
753
753
  "rules": {
754
754
  "@typescript-eslint/member-ordering": [
755
755
  "error",
756
- { "typeLiterals": ["signature", "method", "constructor", "field"] }
757
- ]
758
- }
756
+ { "typeLiterals": ["signature", "method", "constructor", "field"] },
757
+ ],
758
+ },
759
759
  }
760
760
  ```
761
761
 
@@ -805,11 +805,11 @@ You can see the default order in [Default Configuration](#default-configuration)
805
805
  "error",
806
806
  {
807
807
  "default": {
808
- "order": "alphabetically"
809
- }
810
- }
811
- ]
812
- }
808
+ "order": "alphabetically",
809
+ },
810
+ },
811
+ ],
812
+ },
813
813
  }
814
814
  ```
815
815
 
@@ -856,11 +856,11 @@ This config specifies that within each custom `memberTypes` group, members are i
856
856
  {
857
857
  "default": {
858
858
  "memberTypes": ["method", "field"],
859
- "order": "alphabetically"
860
- }
861
- }
862
- ]
863
- }
859
+ "order": "alphabetically",
860
+ },
861
+ },
862
+ ],
863
+ },
864
864
  }
865
865
  ```
866
866
 
@@ -908,11 +908,11 @@ You can see the default order in [Default Configuration](#default-configuration)
908
908
  "error",
909
909
  {
910
910
  "default": {
911
- "order": "alphabetically-case-insensitive"
912
- }
913
- }
914
- ]
915
- }
911
+ "order": "alphabetically-case-insensitive",
912
+ },
913
+ },
914
+ ],
915
+ },
916
916
  }
917
917
  ```
918
918
 
@@ -957,9 +957,9 @@ It ignores any member group types completely by specifying `"never"` for `member
957
957
  "rules": {
958
958
  "@typescript-eslint/member-ordering": [
959
959
  "error",
960
- { "default": { "memberTypes": "never", "order": "alphabetically" } }
961
- ]
962
- }
960
+ { "default": { "memberTypes": "never", "order": "alphabetically" } },
961
+ ],
962
+ },
963
963
  }
964
964
  ```
965
965
 
@@ -1006,11 +1006,11 @@ This config places all optional members before all required members:
1006
1006
  {
1007
1007
  "default": {
1008
1008
  "optionalityOrder": "optional-first",
1009
- "order": "alphabetically"
1010
- }
1011
- }
1012
- ]
1013
- }
1009
+ "order": "alphabetically",
1010
+ },
1011
+ },
1012
+ ],
1013
+ },
1014
1014
  }
1015
1015
  ```
1016
1016
 
@@ -1049,11 +1049,11 @@ This config places all required members before all optional members:
1049
1049
  {
1050
1050
  "default": {
1051
1051
  "optionalityOrder": "required-first",
1052
- "order": "alphabetically"
1053
- }
1054
- }
1055
- ]
1056
- }
1052
+ "order": "alphabetically",
1053
+ },
1054
+ },
1055
+ ],
1056
+ },
1057
1057
  }
1058
1058
  ```
1059
1059
 
@@ -1271,7 +1271,7 @@ It is also possible to group member types by their accessibility (`static`, `ins
1271
1271
  // Methods
1272
1272
  "public-method", // = ["public-static-method", "public-instance-method"]
1273
1273
  "protected-method", // = ["protected-static-method", "protected-instance-method"]
1274
- "private-method" // = ["private-static-method", "private-instance-method"]
1274
+ "private-method", // = ["private-static-method", "private-instance-method"]
1275
1275
  ]
1276
1276
  ```
1277
1277
 
@@ -1317,7 +1317,7 @@ their accessibility.
1317
1317
  "protected-decorated-method",
1318
1318
  "private-decorated-method",
1319
1319
 
1320
- "decorated-method" // = ["public-decorated-method", "protected-decorated-method", "private-decorated-method"]
1320
+ "decorated-method", // = ["public-decorated-method", "protected-decorated-method", "private-decorated-method"]
1321
1321
  ]
1322
1322
  ```
1323
1323
 
@@ -1354,7 +1354,7 @@ Another option is to group the member types by their scope (`public`, `protected
1354
1354
  // Methods
1355
1355
  "static-method", // = ["public-static-method", "protected-static-method", "private-static-method"]
1356
1356
  "instance-method", // = ["public-instance-method", "protected-instance-method", "private-instance-method"]
1357
- "abstract-method" // = ["public-abstract-method", "protected-abstract-method"]
1357
+ "abstract-method", // = ["public-abstract-method", "protected-abstract-method"]
1358
1358
  ]
1359
1359
  ```
1360
1360
 
@@ -1386,7 +1386,7 @@ The third grouping option is to ignore both scope and accessibility.
1386
1386
  // "public-abstract-set", "protected-abstract-set"]
1387
1387
 
1388
1388
  // Methods
1389
- "method" // = ["public-static-method", "protected-static-method", "private-static-method", "public-instance-method", "protected-instance-method", "private-instance-method",
1389
+ "method", // = ["public-static-method", "protected-static-method", "private-static-method", "public-instance-method", "protected-instance-method", "private-instance-method",
1390
1390
  // "public-abstract-method", "protected-abstract-method"]
1391
1391
  ]
1392
1392
  ```
@@ -1403,7 +1403,7 @@ It is possible to group fields by their `readonly` modifiers.
1403
1403
 
1404
1404
  // Fields
1405
1405
  "readonly-field", // = ["public-static-readonly-field", "protected-static-readonly-field", "private-static-readonly-field", "public-instance-readonly-field", "protected-instance-readonly-field", "private-instance-readonly-field", "public-abstract-readonly-field", "protected-abstract-readonly-field"]
1406
- "field" // = ["public-static-field", "protected-static-field", "private-static-field", "public-instance-field", "protected-instance-field", "private-instance-field", "public-abstract-field", "protected-abstract-field"]
1406
+ "field", // = ["public-static-field", "protected-static-field", "private-static-field", "public-instance-field", "protected-instance-field", "private-instance-field", "public-abstract-field", "protected-abstract-field"]
1407
1407
  ]
1408
1408
  ```
1409
1409
 
@@ -1429,7 +1429,7 @@ It is also possible to group different member types at the same rank.
1429
1429
  ["get", "set"],
1430
1430
 
1431
1431
  // Methods
1432
- "method"
1432
+ "method",
1433
1433
  ]
1434
1434
  ```
1435
1435
 
@@ -602,12 +602,12 @@ If you simply want to allow all property names that require quotes, you can use
602
602
  "objectLiteralMethod",
603
603
  "typeMethod",
604
604
  "accessor",
605
- "enumMember"
605
+ "enumMember",
606
606
  ],
607
607
  "format": null,
608
- "modifiers": ["requiresQuotes"]
609
- }
610
- ]
608
+ "modifiers": ["requiresQuotes"],
609
+ },
610
+ ],
611
611
  }
612
612
  ```
613
613
 
@@ -623,10 +623,10 @@ If you have a small and known list of exceptions, you can use the `filter` optio
623
623
  "filter": {
624
624
  // you can expand this regex to add more allowed names
625
625
  "regex": "^(Property-Name-One|Property-Name-Two)$",
626
- "match": false
627
- }
628
- }
629
- ]
626
+ "match": false,
627
+ },
628
+ },
629
+ ],
630
630
  }
631
631
  ```
632
632
 
@@ -642,10 +642,10 @@ You can use the `filter` option to ignore names with specific characters:
642
642
  "filter": {
643
643
  // you can expand this regex as you find more cases that require quoting that you want to allow
644
644
  "regex": "[- ]",
645
- "match": false
646
- }
647
- }
648
- ]
645
+ "match": false,
646
+ },
647
+ },
648
+ ],
649
649
  }
650
650
  ```
651
651
 
@@ -666,9 +666,9 @@ You can use the `destructured` modifier to match these names, and explicitly set
666
666
  {
667
667
  "selector": "variable",
668
668
  "modifiers": ["destructured"],
669
- "format": null
670
- }
671
- ]
669
+ "format": null,
670
+ },
671
+ ],
672
672
  }
673
673
  ```
674
674
 
@@ -28,17 +28,17 @@ You can specify this option for a specific path or pattern as follows:
28
28
  {
29
29
  "name": "import-foo",
30
30
  "message": "Please use import-bar instead.",
31
- "allowTypeImports": true
31
+ "allowTypeImports": true,
32
32
  },
33
33
  {
34
34
  "name": "import-baz",
35
35
  "message": "Please use import-quux instead.",
36
- "allowTypeImports": true
37
- }
38
- ]
39
- }
40
- ]
41
- }
36
+ "allowTypeImports": true,
37
+ },
38
+ ],
39
+ },
40
+ ],
41
+ },
42
42
  }
43
43
  ```
44
44
 
@@ -24,9 +24,9 @@ For example, to add blank lines before interfaces and type definitions:
24
24
  {
25
25
  "blankLine": "always",
26
26
  "prev": "*",
27
- "next": ["interface", "type"]
28
- }
29
- ]
27
+ "next": ["interface", "type"],
28
+ },
29
+ ],
30
30
  }
31
31
  ```
32
32
 
@@ -68,7 +68,10 @@ You may pass `"onlyInlineLambdas": true` as a rule option within an object to re
68
68
 
69
69
  ```jsonc
70
70
  {
71
- "@typescript-eslint/prefer-readonly": ["error", { "onlyInlineLambdas": true }]
71
+ "@typescript-eslint/prefer-readonly": [
72
+ "error",
73
+ { "onlyInlineLambdas": true },
74
+ ],
72
75
  }
73
76
  ```
74
77
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/eslint-plugin",
3
- "version": "6.20.1-alpha.17",
3
+ "version": "6.20.1-alpha.18",
4
4
  "description": "TypeScript plugin for ESLint",
5
5
  "files": [
6
6
  "dist",
@@ -57,10 +57,10 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@eslint-community/regexpp": "^4.5.1",
60
- "@typescript-eslint/scope-manager": "6.20.1-alpha.17",
61
- "@typescript-eslint/type-utils": "6.20.1-alpha.17",
62
- "@typescript-eslint/utils": "6.20.1-alpha.17",
63
- "@typescript-eslint/visitor-keys": "6.20.1-alpha.17",
60
+ "@typescript-eslint/scope-manager": "6.20.1-alpha.18",
61
+ "@typescript-eslint/type-utils": "6.20.1-alpha.18",
62
+ "@typescript-eslint/utils": "6.20.1-alpha.18",
63
+ "@typescript-eslint/visitor-keys": "6.20.1-alpha.18",
64
64
  "debug": "^4.3.4",
65
65
  "graphemer": "^1.4.0",
66
66
  "ignore": "^5.2.4",
@@ -73,8 +73,8 @@
73
73
  "@types/debug": "*",
74
74
  "@types/marked": "*",
75
75
  "@types/natural-compare": "*",
76
- "@typescript-eslint/rule-schema-to-typescript-types": "6.20.1-alpha.17",
77
- "@typescript-eslint/rule-tester": "6.20.1-alpha.17",
76
+ "@typescript-eslint/rule-schema-to-typescript-types": "6.20.1-alpha.18",
77
+ "@typescript-eslint/rule-tester": "6.20.1-alpha.18",
78
78
  "ajv": "^6.12.6",
79
79
  "chalk": "^5.3.0",
80
80
  "cross-fetch": "*",