linted 16.12.2-rc.0 → 16.12.2-rc.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. package/.github/workflows/RELEASE.yml +35 -35
  2. package/.github/workflows/rc.yml +35 -35
  3. package/LICENSE +21 -21
  4. package/README.md +390 -390
  5. package/SECURITY.md +9 -9
  6. package/dist/imports/plugins.d.ts.map +1 -1
  7. package/dist/imports.d.ts.map +1 -1
  8. package/dist/rules/html/enable.d.ts +8 -0
  9. package/dist/rules/html/enable.d.ts.map +1 -0
  10. package/dist/rules/html/enable.js +15 -0
  11. package/dist/rules/html/enable.js.map +1 -0
  12. package/dist/rules/html/enable_recommended.d.ts +3 -0
  13. package/dist/rules/html/enable_recommended.d.ts.map +1 -0
  14. package/dist/rules/html/enable_recommended.js +8 -0
  15. package/dist/rules/html/enable_recommended.js.map +1 -0
  16. package/dist/rules/html.d.ts +8 -0
  17. package/dist/rules/html.d.ts.map +1 -0
  18. package/dist/rules/html.js +4 -0
  19. package/dist/rules/html.js.map +1 -0
  20. package/dist/rules/js/enable.d.ts +348 -0
  21. package/dist/rules/js/enable.d.ts.map +1 -0
  22. package/dist/rules/js/enable.js +496 -0
  23. package/dist/rules/js/enable.js.map +1 -0
  24. package/dist/rules/js/enable_stylistic.d.ts +420 -0
  25. package/dist/rules/js/enable_stylistic.d.ts.map +1 -0
  26. package/dist/rules/js/enable_stylistic.js +585 -0
  27. package/dist/rules/js/enable_stylistic.js.map +1 -0
  28. package/dist/rules/js.d.ts +765 -0
  29. package/dist/rules/js.d.ts.map +1 -0
  30. package/dist/rules/js.js +4 -0
  31. package/dist/rules/js.js.map +1 -0
  32. package/dist/rules/json/enable.d.ts +27 -0
  33. package/dist/rules/json/enable.d.ts.map +1 -0
  34. package/dist/rules/json/enable.js +31 -0
  35. package/dist/rules/json/enable.js.map +1 -0
  36. package/dist/rules/json/enable_x.d.ts.map +1 -1
  37. package/dist/rules/json/enable_x.js +48 -8
  38. package/dist/rules/json/enable_x.js.map +1 -1
  39. package/dist/rules/json.d.ts +74 -0
  40. package/dist/rules/json.d.ts.map +1 -0
  41. package/dist/rules/json.js +4 -0
  42. package/dist/rules/json.js.map +1 -0
  43. package/dist/rules/jsonc/override.d.ts.map +1 -1
  44. package/dist/rules/jsonc/override.js +12 -3
  45. package/dist/rules/jsonc/override.js.map +1 -1
  46. package/dist/rules/jsonc.d.ts +77 -0
  47. package/dist/rules/jsonc.d.ts.map +1 -0
  48. package/dist/rules/jsonc.js +4 -0
  49. package/dist/rules/jsonc.js.map +1 -0
  50. package/dist/rules/md/enable.d.ts +7 -0
  51. package/dist/rules/md/enable.d.ts.map +1 -0
  52. package/dist/rules/md/enable.js +14 -0
  53. package/dist/rules/md/enable.js.map +1 -0
  54. package/dist/rules/md.d.ts +7 -0
  55. package/dist/rules/md.d.ts.map +1 -0
  56. package/dist/rules/md.js +3 -0
  57. package/dist/rules/md.js.map +1 -0
  58. package/dist/rules/mocha/enable.d.ts +3 -0
  59. package/dist/rules/mocha/enable.d.ts.map +1 -0
  60. package/dist/rules/mocha/enable.js +3 -0
  61. package/dist/rules/mocha/enable.js.map +1 -0
  62. package/dist/rules/mocha/enable_recommended.d.ts +3 -0
  63. package/dist/rules/mocha/enable_recommended.d.ts.map +1 -0
  64. package/dist/rules/mocha/enable_recommended.js +8 -0
  65. package/dist/rules/mocha/enable_recommended.js.map +1 -0
  66. package/dist/rules/mocha.d.ts +8 -0
  67. package/dist/rules/mocha.d.ts.map +1 -0
  68. package/dist/rules/mocha.js +4 -0
  69. package/dist/rules/mocha.js.map +1 -0
  70. package/dist/rules/svelte/disable.d.ts +5 -0
  71. package/dist/rules/svelte/disable.d.ts.map +1 -0
  72. package/dist/rules/svelte/disable.js +8 -0
  73. package/dist/rules/svelte/disable.js.map +1 -0
  74. package/dist/rules/svelte/disable_js.d.ts.map +1 -1
  75. package/dist/rules/svelte/disable_js.js +8 -3
  76. package/dist/rules/svelte/disable_js.js.map +1 -1
  77. package/dist/rules/svelte/disable_ts.d.ts.map +1 -1
  78. package/dist/rules/svelte/disable_ts.js +8 -3
  79. package/dist/rules/svelte/disable_ts.js.map +1 -1
  80. package/dist/rules/svelte/enable.d.ts +126 -0
  81. package/dist/rules/svelte/enable.d.ts.map +1 -0
  82. package/dist/rules/svelte/enable.js +190 -0
  83. package/dist/rules/svelte/enable.js.map +1 -0
  84. package/dist/rules/svelte/enable_x.d.ts.map +1 -1
  85. package/dist/rules/svelte/enable_x.js +15 -3
  86. package/dist/rules/svelte/enable_x.js.map +1 -1
  87. package/dist/rules/svelte.d.ts +1269 -0
  88. package/dist/rules/svelte.d.ts.map +1 -0
  89. package/dist/rules/svelte.js +15 -0
  90. package/dist/rules/svelte.js.map +1 -0
  91. package/dist/rules/ts/disable.d.ts +18 -0
  92. package/dist/rules/ts/disable.d.ts.map +1 -0
  93. package/dist/rules/ts/disable.js +21 -0
  94. package/dist/rules/ts/disable.js.map +1 -0
  95. package/dist/rules/ts/disable_x.d.ts.map +1 -1
  96. package/dist/rules/ts/disable_x.js +1 -2
  97. package/dist/rules/ts/disable_x.js.map +1 -1
  98. package/dist/rules/ts/enable.d.ts +262 -0
  99. package/dist/rules/ts/enable.d.ts.map +1 -0
  100. package/dist/rules/ts/enable.js +503 -0
  101. package/dist/rules/ts/enable.js.map +1 -0
  102. package/dist/rules/ts/enable_x.d.ts.map +1 -1
  103. package/dist/rules/ts/enable_x.js +32 -5
  104. package/dist/rules/ts/enable_x.js.map +1 -1
  105. package/dist/rules/ts.d.ts +1133 -0
  106. package/dist/rules/ts.d.ts.map +1 -0
  107. package/dist/rules/ts.js +13 -0
  108. package/dist/rules/ts.js.map +1 -0
  109. package/dist/rules/yml/enable.d.ts +39 -0
  110. package/dist/rules/yml/enable.d.ts.map +1 -0
  111. package/dist/rules/yml/enable.js +60 -0
  112. package/dist/rules/yml/enable.js.map +1 -0
  113. package/dist/rules/yml/enable_x.d.ts.map +1 -1
  114. package/dist/rules/yml/enable_x.js +57 -9
  115. package/dist/rules/yml/enable_x.js.map +1 -1
  116. package/dist/rules/yml.d.ts +73 -0
  117. package/dist/rules/yml.d.ts.map +1 -0
  118. package/dist/rules/yml.js +4 -0
  119. package/dist/rules/yml.js.map +1 -0
  120. package/dist/rules.d.ts +75 -75
  121. package/dist/rules.js +9 -9
  122. package/dist/rules.js.map +1 -1
  123. package/eslint.config.js +3 -3
  124. package/package.json +99 -99
  125. package/src/files/html.ts +1 -1
  126. package/src/files/js.ts +1 -1
  127. package/src/files/json.ts +1 -1
  128. package/src/files/jsonc.ts +4 -4
  129. package/src/files/md.ts +1 -1
  130. package/src/files/mocha.ts +1 -1
  131. package/src/files/svelte.ts +1 -1
  132. package/src/files/ts.ts +5 -5
  133. package/src/files/yml.ts +5 -5
  134. package/src/files.ts +22 -22
  135. package/src/imports/parsers.ts +15 -15
  136. package/src/imports/plugins.ts +19 -19
  137. package/src/imports.ts +8 -8
  138. package/src/index.ts +36 -36
  139. package/src/rules/_strings/id.ts +18 -18
  140. package/src/rules/_strings/level.ts +6 -6
  141. package/src/rules/_strings/state.ts +56 -56
  142. package/src/rules/_strings.ts +6 -6
  143. package/src/rules/html/enable.ts +16 -0
  144. package/src/rules/html/enable_recommended.ts +9 -0
  145. package/src/rules/html.ts +4 -0
  146. package/src/rules/js/enable.ts +524 -0
  147. package/src/rules/js/enable_stylistic.ts +608 -0
  148. package/src/rules/js.ts +4 -0
  149. package/src/rules/json/{_enable.ts → enable.ts} +33 -35
  150. package/src/rules/json/enable_x.ts +89 -50
  151. package/src/rules/{_json.ts → json.ts} +4 -4
  152. package/src/rules/jsonc/override.ts +16 -9
  153. package/src/rules/{_jsonc.ts → jsonc.ts} +4 -4
  154. package/src/rules/md/enable.ts +15 -0
  155. package/src/rules/md.ts +3 -0
  156. package/src/rules/mocha/enable.ts +3 -0
  157. package/src/rules/mocha/enable_recommended.ts +9 -0
  158. package/src/rules/mocha.ts +4 -0
  159. package/src/rules/svelte/disable.ts +9 -0
  160. package/src/rules/svelte/disable_js.ts +11 -7
  161. package/src/rules/svelte/disable_ts.ts +9 -5
  162. package/src/rules/svelte/{_enable.ts → enable.ts} +228 -129
  163. package/src/rules/svelte/enable_x.ts +20 -9
  164. package/src/rules/{_svelte.ts → svelte.ts} +15 -15
  165. package/src/rules/ts/{disable_compiler.ts → disable.ts} +22 -23
  166. package/src/rules/ts/disable_x.ts +32 -36
  167. package/src/rules/ts/{_enable.ts → enable.ts} +549 -406
  168. package/src/rules/ts/enable_x.ts +115 -90
  169. package/src/rules/{_ts.ts → ts.ts} +13 -13
  170. package/src/rules/yml/{_enable.ts → enable.ts} +64 -33
  171. package/src/rules/yml/enable_x.ts +68 -21
  172. package/src/rules/{_yml.ts → yml.ts} +4 -4
  173. package/src/rules.ts +22 -22
  174. package/tsconfig.json +161 -161
  175. package/types/markdownlint/index.d.ts +3 -3
  176. package/types/markdownlint/parser.d.ts +9 -9
  177. package/types/mocha/index.d.ts +8 -8
  178. package/src/rules/_html.ts +0 -4
  179. package/src/rules/_js.ts +0 -4
  180. package/src/rules/_md.ts +0 -3
  181. package/src/rules/_mocha.ts +0 -4
  182. package/src/rules/html/_enable.ts +0 -13
  183. package/src/rules/html/_recommended.ts +0 -7
  184. package/src/rules/js/_enable.ts +0 -287
  185. package/src/rules/js/stylistic.ts +0 -294
  186. package/src/rules/md/_enable.ts +0 -14
  187. package/src/rules/mocha/_enable.ts +0 -5
  188. package/src/rules/mocha/_recommended.ts +0 -7
  189. package/src/rules/svelte/disable_x.ts +0 -8
@@ -1,406 +1,549 @@
1
- import { id, level, state } from "../_strings.js";
2
-
3
- const
4
- { enable } = id,
5
- { ERROR, OFF } = level,
6
- { Never, Explicit } = state;
7
-
8
- export default [
9
- enable,
10
- {
11
- // https://typescript-eslint.io/rules/?=xextension-xdeprecated#rules ]
12
- "@typescript-eslint/adjacent-overload-signatures": OFF,
13
- "@typescript-eslint/array-type": [ERROR, { "default": "array", readonly: "array" }],
14
- "@typescript-eslint/await-thenable": ERROR,
15
- "@typescript-eslint/ban-ts-comment": [
16
- ERROR,
17
- {
18
- "ts-check": false,
19
- "ts-expect-error": { descriptionFormat: "^: BUG: .+$" },
20
- "ts-ignore": true,
21
- "ts-nocheck": true,
22
- minimumDescriptionLength: 32,
23
- },
24
- ],
25
- "@typescript-eslint/ban-tslint-comment": ERROR,
26
- "@typescript-eslint/class-literal-property-style": [ERROR, "fields"],
27
- "@typescript-eslint/consistent-generic-constructors": [ERROR, "constructor"],
28
- "@typescript-eslint/consistent-indexed-object-style": [ERROR, "record"],
29
- "@typescript-eslint/consistent-type-assertions": [ERROR, { assertionStyle: "as", objectLiteralTypeAssertions: Never }],
30
- "@typescript-eslint/consistent-type-definitions": OFF,
31
- "@typescript-eslint/consistent-type-exports": [ERROR, { fixMixedExportsWithInlineTypeSpecifier: false }],
32
- "@typescript-eslint/consistent-type-imports": [ERROR, { disallowTypeAnnotations: true, fixStyle: "separate-type-imports", prefer: "type-imports" }],
33
- "@typescript-eslint/explicit-function-return-type": OFF,
34
- "@typescript-eslint/explicit-member-accessibility": [
35
- ERROR,
36
- {
37
- accessibility: Explicit,
38
- ignoredMethodNames: [],
39
- overrides: {
40
- properties: Explicit,
41
- constructors: "no-public",
42
- accessors: Explicit,
43
- methods: Explicit,
44
- parameterProperties: Explicit,
45
- },
46
- },
47
- ],
48
- "@typescript-eslint/explicit-module-boundary-types": OFF,
49
- "@typescript-eslint/member-ordering": [
50
- ERROR,
51
- {
52
- "default": {
53
- memberTypes: [
54
- // Index signature
55
- "signature",
56
- "call-signature",
57
-
58
- // Fields
59
- "public-static-field",
60
- "protected-static-field",
61
- "private-static-field",
62
- "#private-static-field",
63
-
64
- "public-decorated-field",
65
- "protected-decorated-field",
66
- "private-decorated-field",
67
-
68
- "public-instance-field",
69
- "protected-instance-field",
70
- "private-instance-field",
71
- "#private-instance-field",
72
-
73
- "public-abstract-field",
74
- "protected-abstract-field",
75
-
76
- "public-field",
77
- "protected-field",
78
- "private-field",
79
- "#private-field",
80
-
81
- "static-field",
82
- "instance-field",
83
- "abstract-field",
84
- "decorated-field",
85
- "field",
86
-
87
- // Static initialization
88
- "static-initialization",
89
-
90
- // Constructors
91
- "public-constructor",
92
- "protected-constructor",
93
- "private-constructor",
94
- "constructor",
95
-
96
- // Accessors
97
- "public-static-accessor",
98
- "protected-static-accessor",
99
- "private-static-accessor",
100
- "#private-static-accessor",
101
-
102
- "public-decorated-accessor",
103
- "protected-decorated-accessor",
104
- "private-decorated-accessor",
105
-
106
- "public-instance-accessor",
107
- "protected-instance-accessor",
108
- "private-instance-accessor",
109
- "#private-instance-accessor",
110
-
111
- "public-abstract-accessor",
112
- "protected-abstract-accessor",
113
-
114
- "public-accessor",
115
- "protected-accessor",
116
- "private-accessor",
117
- "#private-accessor",
118
-
119
- "static-accessor",
120
- "instance-accessor",
121
- "abstract-accessor",
122
- "decorated-accessor",
123
- "accessor",
124
-
125
- // Getters
126
- "public-static-get",
127
- "protected-static-get",
128
- "private-static-get",
129
- "#private-static-get",
130
-
131
- "public-decorated-get",
132
- "protected-decorated-get",
133
- "private-decorated-get",
134
-
135
- "public-instance-get",
136
- "protected-instance-get",
137
- "private-instance-get",
138
- "#private-instance-get",
139
-
140
- "public-abstract-get",
141
- "protected-abstract-get",
142
-
143
- "public-get",
144
- "protected-get",
145
- "private-get",
146
- "#private-get",
147
-
148
- "static-get",
149
- "instance-get",
150
- "abstract-get",
151
- "decorated-get",
152
- "get",
153
-
154
- // Setters
155
- "public-static-set",
156
- "protected-static-set",
157
- "private-static-set",
158
- "#private-static-set",
159
-
160
- "public-decorated-set",
161
- "protected-decorated-set",
162
- "private-decorated-set",
163
-
164
- "public-instance-set",
165
- "protected-instance-set",
166
- "private-instance-set",
167
- "#private-instance-set",
168
-
169
- "public-abstract-set",
170
- "protected-abstract-set",
171
-
172
- "public-set",
173
- "protected-set",
174
- "private-set",
175
- "#private-set",
176
-
177
- "static-set",
178
- "instance-set",
179
- "abstract-set",
180
- "decorated-set",
181
- "set",
182
-
183
- // Methods
184
- "public-static-method",
185
- "protected-static-method",
186
- "private-static-method",
187
- "#private-static-method",
188
-
189
- "public-decorated-method",
190
- "protected-decorated-method",
191
- "private-decorated-method",
192
-
193
- "public-instance-method",
194
- "protected-instance-method",
195
- "private-instance-method",
196
- "#private-instance-method",
197
-
198
- "public-abstract-method",
199
- "protected-abstract-method",
200
-
201
- "public-method",
202
- "protected-method",
203
- "private-method",
204
- "#private-method",
205
-
206
- "static-method",
207
- "instance-method",
208
- "abstract-method",
209
- "decorated-method",
210
- "method",
211
- ],
212
- optionalityOrder: "required-first",
213
- order: "as-written",
214
- },
215
-
216
- },
217
- ],
218
- "@typescript-eslint/method-signature-style": [ERROR, "property"],
219
- "@typescript-eslint/naming-convention": OFF,
220
- "@typescript-eslint/no-array-delete": ERROR,
221
- "@typescript-eslint/no-base-to-string": [
222
- ERROR,
223
- {
224
- ignoredTypeNames: [
225
- "Error",
226
- "RegExp",
227
- "URL",
228
- "URLSearchParams",
229
- ],
230
- },
231
- ],
232
- "@typescript-eslint/no-confusing-non-null-assertion": ERROR,
233
- "@typescript-eslint/no-confusing-void-expression": [ERROR, { ignoreArrowShorthand: true, ignoreVoidOperator: true }],
234
- "@typescript-eslint/no-duplicate-enum-values": ERROR,
235
- "@typescript-eslint/no-duplicate-type-constituents": [ERROR, { ignoreIntersections: false, ignoreUnions: false }],
236
- "@typescript-eslint/no-dynamic-delete": ERROR,
237
- "@typescript-eslint/no-empty-object-type": [
238
- ERROR,
239
- {
240
- // allowWithName: /regex/,
241
- allowInterfaces: Never,
242
- allowObjectTypes: Never,
243
- },
244
- ],
245
- "@typescript-eslint/no-explicit-any": [ERROR, { fixToUnknown: true, ignoreRestArgs: false }],
246
- "@typescript-eslint/no-extra-non-null-assertion": ERROR,
247
- "@typescript-eslint/no-extraneous-class": [
248
- ERROR,
249
- {
250
- allowConstructorOnly: false,
251
- allowEmpty: true,
252
- allowStaticOnly: false,
253
- allowWithDecorator: false,
254
- },
255
- ],
256
- "@typescript-eslint/no-floating-promises": [ERROR, { checkThenables: true, ignoreVoid: true, ignoreIIFE: false }],
257
- "@typescript-eslint/no-for-in-array": ERROR,
258
- "@typescript-eslint/no-import-type-side-effects": ERROR,
259
- "@typescript-eslint/no-inferrable-types": [ERROR, { ignoreParameters: false, ignoreProperties: false }],
260
- "@typescript-eslint/no-invalid-void-type": [ERROR, { allowInGenericTypeArguments: true, allowAsThisParameter: false }],
261
- "@typescript-eslint/no-meaningless-void-operator": [ERROR, { checkNever: true }],
262
- "@typescript-eslint/no-misused-new": ERROR,
263
- "@typescript-eslint/no-misused-promises": [
264
- ERROR,
265
- {
266
- checksConditionals: true,
267
- checksSpreads: true,
268
- checksVoidReturn: {
269
- arguments: true,
270
- attributes: true,
271
- properties: true,
272
- returns: true,
273
- variables: true,
274
- },
275
- },
276
- ],
277
- "@typescript-eslint/no-mixed-enums": ERROR,
278
- "@typescript-eslint/no-namespace": OFF,
279
- "@typescript-eslint/no-non-null-asserted-nullish-coalescing": ERROR,
280
- "@typescript-eslint/no-non-null-asserted-optional-chain": ERROR,
281
- "@typescript-eslint/no-non-null-assertion": ERROR,
282
- "@typescript-eslint/no-redundant-type-constituents": ERROR,
283
- "@typescript-eslint/no-restricted-types": OFF, /* preference - no shared custom types across all projects that I wish to ban*/
284
- "@typescript-eslint/no-require-imports": [ERROR, { allow: [] }],
285
- "@typescript-eslint/no-this-alias": [ERROR, { allowDestructuring: true, allowedNames: [] }],
286
- "@typescript-eslint/no-unnecessary-boolean-literal-compare": [ERROR, { allowComparingNullableBooleansToTrue: true, allowComparingNullableBooleansToFalse: true }],
287
- "@typescript-eslint/no-unnecessary-condition": [ERROR, { allowConstantLoopConditions: false, allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false }],
288
- "@typescript-eslint/no-unnecessary-qualifier": ERROR,
289
- "@typescript-eslint/no-unnecessary-template-expression": ERROR,
290
- "@typescript-eslint/no-unnecessary-type-arguments": ERROR,
291
- "@typescript-eslint/no-unnecessary-type-assertion": [ERROR, { typesToIgnore: [] }],
292
- "@typescript-eslint/no-unnecessary-type-constraint": ERROR,
293
- "@typescript-eslint/no-unnecessary-type-parameters": ERROR,
294
- "@typescript-eslint/no-unsafe-argument": ERROR,
295
- "@typescript-eslint/no-unsafe-assignment": ERROR,
296
- "@typescript-eslint/no-unsafe-call": ERROR,
297
- "@typescript-eslint/no-unsafe-declaration-merging": ERROR,
298
- "@typescript-eslint/no-unsafe-enum-comparison": ERROR,
299
- "@typescript-eslint/no-unsafe-function-type": ERROR,
300
- "@typescript-eslint/no-unsafe-member-access": ERROR,
301
- "@typescript-eslint/no-unsafe-return": ERROR,
302
- "@typescript-eslint/no-unsafe-unary-minus": ERROR,
303
- "@typescript-eslint/no-useless-empty-export": ERROR,
304
- "@typescript-eslint/no-wrapper-object-types": ERROR,
305
- "@typescript-eslint/non-nullable-type-assertion-style": OFF,
306
- "@typescript-eslint/parameter-properties": [ERROR, { prefer: "parameter-property" /* "parameter-property" | "class-property" */ }],
307
- "@typescript-eslint/prefer-as-const": ERROR,
308
- "@typescript-eslint/prefer-enum-initializers": ERROR,
309
- "@typescript-eslint/prefer-find": ERROR,
310
- "@typescript-eslint/prefer-for-of": ERROR,
311
- "@typescript-eslint/prefer-function-type": ERROR,
312
- "@typescript-eslint/prefer-includes": ERROR,
313
- "@typescript-eslint/prefer-literal-enum-member": [ERROR, { allowBitwiseExpressions: false }],
314
- "@typescript-eslint/prefer-namespace-keyword": ERROR,
315
- "@typescript-eslint/prefer-nullish-coalescing": [
316
- ERROR,
317
- {
318
- allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
319
- ignoreConditionalTests: false,
320
- ignoreTernaryTests: false,
321
- ignoreMixedLogicalExpressions: false,
322
- ignorePrimitives: {
323
- bigint: false,
324
- "boolean": false,
325
- number: false,
326
- string: false,
327
- },
328
- },
329
- ], /* requires tsconfig: strictNullChecks */
330
- "@typescript-eslint/prefer-optional-chain": [
331
- ERROR,
332
- {
333
- allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false,
334
- checkAny: true,
335
- checkBigInt: true,
336
- checkBoolean: true,
337
- checkNumber: true,
338
- checkString: true,
339
- checkUnknown: true,
340
- requireNullish: false,
341
- },
342
- ],
343
- "@typescript-eslint/prefer-readonly": [ERROR, { onlyInlineLambdas: false }],
344
- "@typescript-eslint/prefer-readonly-parameter-types": OFF, /* preference - WAY too restrictive */
345
- "@typescript-eslint/prefer-reduce-type-parameter": ERROR,
346
- "@typescript-eslint/prefer-regexp-exec": ERROR,
347
- "@typescript-eslint/prefer-return-this-type": ERROR,
348
- "@typescript-eslint/prefer-string-starts-ends-with": [ERROR, { allowSingleElementEquality: Never }],
349
- "@typescript-eslint/promise-function-async": [
350
- ERROR,
351
- {
352
- allowAny: false,
353
- allowedPromiseNames: [],
354
- checkArrowFunctions: true,
355
- checkFunctionDeclarations: true,
356
- checkFunctionExpressions: true,
357
- checkMethodDeclarations: true,
358
- },
359
- ],
360
- "@typescript-eslint/require-array-sort-compare": [ERROR, { ignoreStringArrays: true }],
361
- "@typescript-eslint/restrict-plus-operands": [
362
- ERROR,
363
- {
364
- allowAny: false,
365
- allowBoolean: false,
366
- allowNullish: false,
367
- allowNumberAndString: false,
368
- allowRegExp: false,
369
- skipCompoundAssignments: false,
370
- },
371
- ],
372
- "@typescript-eslint/restrict-template-expressions": [
373
- ERROR,
374
- {
375
- allowAny: true,
376
- allowArray: true,
377
- allowBoolean: true,
378
- allowNullish: false,
379
- allowNumber: true,
380
- allowNever: false,
381
- allowRegExp: false,
382
- }, /* investigate: make stricter */
383
- ],
384
- "@typescript-eslint/return-await": [ERROR, "in-try-catch"], /* BUG: doc incorrectly states that this extends the DEPRECATED (since 8.46) no-return-await: https://typescript-eslint.io/rules/return-await */
385
- "@typescript-eslint/strict-boolean-expressions": [
386
- ERROR,
387
- {
388
- allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
389
- allowAny: false,
390
- allowNumber: true,
391
- allowString: false,
392
- allowNullableBoolean: false,
393
- allowNullableEnum: false,
394
- allowNullableNumber: false,
395
- allowNullableObject: false,
396
- allowNullableString: false,
397
- },
398
- ], /* requires tsconfig: strictNullChecks */
399
- "@typescript-eslint/switch-exhaustiveness-check": [ERROR, { allowDefaultCaseForExhaustiveSwitch: false, requireDefaultForNonUnion: true }],
400
- "@typescript-eslint/triple-slash-reference": [ERROR, { lib: Never /** always | never */, path: Never /** always | never */, types: Never /** always | never | prefer-import */ }],
401
- "@typescript-eslint/typedef": OFF, /* tsconfig: { noImplicitAny, strictPropertyInitialization } */
402
- "@typescript-eslint/unbound-method": [ERROR, { ignoreStatic: false }],
403
- "@typescript-eslint/unified-signatures": [ERROR, { ignoreDifferentlyNamedParameters: false }],
404
- "@typescript-eslint/use-unknown-in-catch-callback-variable": ERROR,
405
- },
406
- ] as const;
1
+ import { enable, level, state } from "../_strings.js";
2
+
3
+ const
4
+ { ERROR, OFF } = level,
5
+ { Never, Explicit } = state;
6
+
7
+ export default [
8
+ enable,
9
+ {
10
+ // https://typescript-eslint.io/rules/?=xextension-xdeprecated#rules
11
+ "@typescript-eslint/adjacent-overload-signatures": OFF,
12
+ "@typescript-eslint/array-type": [
13
+ ERROR,
14
+ {
15
+ "default": "array",
16
+ readonly: "array",
17
+ },
18
+ ],
19
+ "@typescript-eslint/await-thenable": ERROR,
20
+ "@typescript-eslint/ban-ts-comment": [
21
+ ERROR,
22
+ {
23
+ "ts-check": false,
24
+ "ts-expect-error": {
25
+ descriptionFormat: "^: BUG: .+$",
26
+ },
27
+ "ts-ignore": true,
28
+ "ts-nocheck": true,
29
+ minimumDescriptionLength: 32,
30
+ },
31
+ ],
32
+ "@typescript-eslint/ban-tslint-comment": ERROR,
33
+ "@typescript-eslint/class-literal-property-style": [ERROR, "fields"],
34
+ "@typescript-eslint/consistent-generic-constructors": [ERROR, "constructor"],
35
+ "@typescript-eslint/consistent-indexed-object-style": [ERROR, "record"],
36
+ "@typescript-eslint/consistent-type-assertions": [
37
+ ERROR,
38
+ {
39
+ assertionStyle: "as",
40
+ objectLiteralTypeAssertions: Never,
41
+ },
42
+ ],
43
+ "@typescript-eslint/consistent-type-definitions": OFF,
44
+ "@typescript-eslint/consistent-type-exports": [
45
+ ERROR,
46
+ {
47
+ fixMixedExportsWithInlineTypeSpecifier: false,
48
+ },
49
+ ],
50
+ "@typescript-eslint/consistent-type-imports": [
51
+ ERROR,
52
+ {
53
+ disallowTypeAnnotations: true,
54
+ fixStyle: "separate-type-imports",
55
+ prefer: "type-imports",
56
+ },
57
+ ],
58
+ "@typescript-eslint/explicit-function-return-type": OFF,
59
+ "@typescript-eslint/explicit-member-accessibility": [
60
+ ERROR,
61
+ {
62
+ accessibility: Explicit,
63
+ ignoredMethodNames: [],
64
+ overrides: {
65
+ properties: Explicit,
66
+ constructors: "no-public",
67
+ accessors: Explicit,
68
+ methods: Explicit,
69
+ parameterProperties: Explicit,
70
+ },
71
+ },
72
+ ],
73
+ "@typescript-eslint/explicit-module-boundary-types": OFF,
74
+ "@typescript-eslint/member-ordering": [
75
+ ERROR,
76
+ {
77
+ "default": {
78
+ memberTypes: [
79
+ // Index signature
80
+ "signature",
81
+ "call-signature",
82
+
83
+ // Fields
84
+ "public-static-field",
85
+ "protected-static-field",
86
+ "private-static-field",
87
+ "#private-static-field",
88
+
89
+ "public-decorated-field",
90
+ "protected-decorated-field",
91
+ "private-decorated-field",
92
+
93
+ "public-instance-field",
94
+ "protected-instance-field",
95
+ "private-instance-field",
96
+ "#private-instance-field",
97
+
98
+ "public-abstract-field",
99
+ "protected-abstract-field",
100
+
101
+ "public-field",
102
+ "protected-field",
103
+ "private-field",
104
+ "#private-field",
105
+
106
+ "static-field",
107
+ "instance-field",
108
+ "abstract-field",
109
+ "decorated-field",
110
+ "field",
111
+
112
+ // Static initialization
113
+ "static-initialization",
114
+
115
+ // Constructors
116
+ "public-constructor",
117
+ "protected-constructor",
118
+ "private-constructor",
119
+ "constructor",
120
+
121
+ // Accessors
122
+ "public-static-accessor",
123
+ "protected-static-accessor",
124
+ "private-static-accessor",
125
+ "#private-static-accessor",
126
+
127
+ "public-decorated-accessor",
128
+ "protected-decorated-accessor",
129
+ "private-decorated-accessor",
130
+
131
+ "public-instance-accessor",
132
+ "protected-instance-accessor",
133
+ "private-instance-accessor",
134
+ "#private-instance-accessor",
135
+
136
+ "public-abstract-accessor",
137
+ "protected-abstract-accessor",
138
+
139
+ "public-accessor",
140
+ "protected-accessor",
141
+ "private-accessor",
142
+ "#private-accessor",
143
+
144
+ "static-accessor",
145
+ "instance-accessor",
146
+ "abstract-accessor",
147
+ "decorated-accessor",
148
+ "accessor",
149
+
150
+ // Getters
151
+ "public-static-get",
152
+ "protected-static-get",
153
+ "private-static-get",
154
+ "#private-static-get",
155
+
156
+ "public-decorated-get",
157
+ "protected-decorated-get",
158
+ "private-decorated-get",
159
+
160
+ "public-instance-get",
161
+ "protected-instance-get",
162
+ "private-instance-get",
163
+ "#private-instance-get",
164
+
165
+ "public-abstract-get",
166
+ "protected-abstract-get",
167
+
168
+ "public-get",
169
+ "protected-get",
170
+ "private-get",
171
+ "#private-get",
172
+
173
+ "static-get",
174
+ "instance-get",
175
+ "abstract-get",
176
+ "decorated-get",
177
+ "get",
178
+
179
+ // Setters
180
+ "public-static-set",
181
+ "protected-static-set",
182
+ "private-static-set",
183
+ "#private-static-set",
184
+
185
+ "public-decorated-set",
186
+ "protected-decorated-set",
187
+ "private-decorated-set",
188
+
189
+ "public-instance-set",
190
+ "protected-instance-set",
191
+ "private-instance-set",
192
+ "#private-instance-set",
193
+
194
+ "public-abstract-set",
195
+ "protected-abstract-set",
196
+
197
+ "public-set",
198
+ "protected-set",
199
+ "private-set",
200
+ "#private-set",
201
+
202
+ "static-set",
203
+ "instance-set",
204
+ "abstract-set",
205
+ "decorated-set",
206
+ "set",
207
+
208
+ // Methods
209
+ "public-static-method",
210
+ "protected-static-method",
211
+ "private-static-method",
212
+ "#private-static-method",
213
+
214
+ "public-decorated-method",
215
+ "protected-decorated-method",
216
+ "private-decorated-method",
217
+
218
+ "public-instance-method",
219
+ "protected-instance-method",
220
+ "private-instance-method",
221
+ "#private-instance-method",
222
+
223
+ "public-abstract-method",
224
+ "protected-abstract-method",
225
+
226
+ "public-method",
227
+ "protected-method",
228
+ "private-method",
229
+ "#private-method",
230
+
231
+ "static-method",
232
+ "instance-method",
233
+ "abstract-method",
234
+ "decorated-method",
235
+ "method",
236
+ ],
237
+ optionalityOrder: "required-first",
238
+ order: "as-written",
239
+ },
240
+
241
+ },
242
+ ],
243
+ "@typescript-eslint/method-signature-style": [ERROR, "property"],
244
+ "@typescript-eslint/naming-convention": OFF,
245
+ "@typescript-eslint/no-array-delete": ERROR,
246
+ "@typescript-eslint/no-base-to-string": [
247
+ ERROR,
248
+ {
249
+ ignoredTypeNames: [
250
+ "Error",
251
+ "RegExp",
252
+ "URL",
253
+ "URLSearchParams",
254
+ ],
255
+ },
256
+ ],
257
+ "@typescript-eslint/no-confusing-non-null-assertion": ERROR,
258
+ "@typescript-eslint/no-confusing-void-expression": [
259
+ ERROR,
260
+ {
261
+ ignoreArrowShorthand: true,
262
+ ignoreVoidOperator: true,
263
+ },
264
+ ],
265
+ "@typescript-eslint/no-duplicate-enum-values": ERROR,
266
+ "@typescript-eslint/no-duplicate-type-constituents": [
267
+ ERROR,
268
+ {
269
+ ignoreIntersections: false,
270
+ ignoreUnions: false,
271
+ },
272
+ ],
273
+ "@typescript-eslint/no-dynamic-delete": ERROR,
274
+ "@typescript-eslint/no-empty-object-type": [
275
+ ERROR,
276
+ {
277
+ // allowWithName: /regex/,
278
+ allowInterfaces: Never,
279
+ allowObjectTypes: Never,
280
+ },
281
+ ],
282
+ "@typescript-eslint/no-explicit-any": [
283
+ ERROR,
284
+ {
285
+ fixToUnknown: true,
286
+ ignoreRestArgs: false,
287
+ },
288
+ ],
289
+ "@typescript-eslint/no-extra-non-null-assertion": ERROR,
290
+ "@typescript-eslint/no-extraneous-class": [
291
+ ERROR,
292
+ {
293
+ allowConstructorOnly: false,
294
+ allowEmpty: true,
295
+ allowStaticOnly: false,
296
+ allowWithDecorator: false,
297
+ },
298
+ ],
299
+ "@typescript-eslint/no-floating-promises": [
300
+ ERROR,
301
+ {
302
+ checkThenables: true,
303
+ ignoreVoid: true,
304
+ ignoreIIFE: false,
305
+ },
306
+ ],
307
+ "@typescript-eslint/no-for-in-array": ERROR,
308
+ "@typescript-eslint/no-import-type-side-effects": ERROR,
309
+ "@typescript-eslint/no-inferrable-types": [
310
+ ERROR,
311
+ {
312
+ ignoreParameters: false,
313
+ ignoreProperties: false,
314
+ },
315
+ ],
316
+ "@typescript-eslint/no-invalid-void-type": [
317
+ ERROR,
318
+ {
319
+ allowInGenericTypeArguments: true,
320
+ allowAsThisParameter: false,
321
+ },
322
+ ],
323
+ "@typescript-eslint/no-meaningless-void-operator": [
324
+ ERROR,
325
+ {
326
+ checkNever: true,
327
+ },
328
+ ],
329
+ "@typescript-eslint/no-misused-new": ERROR,
330
+ "@typescript-eslint/no-misused-promises": [
331
+ ERROR,
332
+ {
333
+ checksConditionals: true,
334
+ checksSpreads: true,
335
+ checksVoidReturn: {
336
+ arguments: true,
337
+ attributes: true,
338
+ properties: true,
339
+ returns: true,
340
+ variables: true,
341
+ },
342
+ },
343
+ ],
344
+ "@typescript-eslint/no-mixed-enums": ERROR,
345
+ "@typescript-eslint/no-namespace": OFF,
346
+ "@typescript-eslint/no-non-null-asserted-nullish-coalescing": ERROR,
347
+ "@typescript-eslint/no-non-null-asserted-optional-chain": ERROR,
348
+ "@typescript-eslint/no-non-null-assertion": ERROR,
349
+ "@typescript-eslint/no-redundant-type-constituents": ERROR,
350
+ "@typescript-eslint/no-restricted-types": OFF /* preference - no shared custom types across all projects that I wish to ban*/,
351
+ "@typescript-eslint/no-require-imports": [
352
+ ERROR,
353
+ {
354
+ allow: [],
355
+ },
356
+ ],
357
+ "@typescript-eslint/no-this-alias": [
358
+ ERROR,
359
+ {
360
+ allowDestructuring: true,
361
+ allowedNames: [],
362
+ },
363
+ ],
364
+ "@typescript-eslint/no-unnecessary-boolean-literal-compare": [
365
+ ERROR,
366
+ {
367
+ allowComparingNullableBooleansToTrue: true,
368
+ allowComparingNullableBooleansToFalse: true,
369
+ },
370
+ ],
371
+ "@typescript-eslint/no-unnecessary-condition": [
372
+ ERROR,
373
+ {
374
+ allowConstantLoopConditions: false,
375
+ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
376
+ },
377
+ ],
378
+ "@typescript-eslint/no-unnecessary-qualifier": ERROR,
379
+ "@typescript-eslint/no-unnecessary-template-expression": ERROR,
380
+ "@typescript-eslint/no-unnecessary-type-arguments": ERROR,
381
+ "@typescript-eslint/no-unnecessary-type-assertion": [
382
+ ERROR,
383
+ {
384
+ typesToIgnore: [],
385
+ },
386
+ ],
387
+ "@typescript-eslint/no-unnecessary-type-constraint": ERROR,
388
+ "@typescript-eslint/no-unnecessary-type-parameters": ERROR,
389
+ "@typescript-eslint/no-unsafe-argument": ERROR,
390
+ "@typescript-eslint/no-unsafe-assignment": ERROR,
391
+ "@typescript-eslint/no-unsafe-call": ERROR,
392
+ "@typescript-eslint/no-unsafe-declaration-merging": ERROR,
393
+ "@typescript-eslint/no-unsafe-enum-comparison": ERROR,
394
+ "@typescript-eslint/no-unsafe-function-type": ERROR,
395
+ "@typescript-eslint/no-unsafe-member-access": ERROR,
396
+ "@typescript-eslint/no-unsafe-return": ERROR,
397
+ "@typescript-eslint/no-unsafe-unary-minus": ERROR,
398
+ "@typescript-eslint/no-useless-empty-export": ERROR,
399
+ "@typescript-eslint/no-wrapper-object-types": ERROR,
400
+ "@typescript-eslint/non-nullable-type-assertion-style": OFF,
401
+ "@typescript-eslint/parameter-properties": [
402
+ ERROR,
403
+ {
404
+ prefer: "parameter-property" /* "parameter-property" | "class-property" */,
405
+ },
406
+ ],
407
+ "@typescript-eslint/prefer-as-const": ERROR,
408
+ "@typescript-eslint/prefer-enum-initializers": ERROR,
409
+ "@typescript-eslint/prefer-find": ERROR,
410
+ "@typescript-eslint/prefer-for-of": ERROR,
411
+ "@typescript-eslint/prefer-function-type": ERROR,
412
+ "@typescript-eslint/prefer-includes": ERROR,
413
+ "@typescript-eslint/prefer-literal-enum-member": [
414
+ ERROR,
415
+ {
416
+ allowBitwiseExpressions: false,
417
+ },
418
+ ],
419
+ "@typescript-eslint/prefer-namespace-keyword": ERROR,
420
+ "@typescript-eslint/prefer-nullish-coalescing": [
421
+ ERROR,
422
+ {
423
+ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
424
+ ignoreConditionalTests: false,
425
+ ignoreTernaryTests: false,
426
+ ignoreMixedLogicalExpressions: false,
427
+ ignorePrimitives: {
428
+ bigint: false,
429
+ "boolean": false,
430
+ number: false,
431
+ string: false,
432
+ },
433
+ },
434
+ ], /* requires tsconfig: strictNullChecks */
435
+ "@typescript-eslint/prefer-optional-chain": [
436
+ ERROR,
437
+ {
438
+ allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false,
439
+ checkAny: true,
440
+ checkBigInt: true,
441
+ checkBoolean: true,
442
+ checkNumber: true,
443
+ checkString: true,
444
+ checkUnknown: true,
445
+ requireNullish: false,
446
+ },
447
+ ],
448
+ "@typescript-eslint/prefer-readonly": [
449
+ ERROR,
450
+ {
451
+ onlyInlineLambdas: false,
452
+ },
453
+ ],
454
+ "@typescript-eslint/prefer-readonly-parameter-types": OFF /* preference - WAY too restrictive */,
455
+ "@typescript-eslint/prefer-reduce-type-parameter": ERROR,
456
+ "@typescript-eslint/prefer-regexp-exec": ERROR,
457
+ "@typescript-eslint/prefer-return-this-type": ERROR,
458
+ "@typescript-eslint/prefer-string-starts-ends-with": [
459
+ ERROR,
460
+ {
461
+ allowSingleElementEquality: Never,
462
+ },
463
+ ],
464
+ "@typescript-eslint/promise-function-async": [
465
+ ERROR,
466
+ {
467
+ allowAny: false,
468
+ allowedPromiseNames: [],
469
+ checkArrowFunctions: true,
470
+ checkFunctionDeclarations: true,
471
+ checkFunctionExpressions: true,
472
+ checkMethodDeclarations: true,
473
+ },
474
+ ],
475
+ "@typescript-eslint/require-array-sort-compare": [
476
+ ERROR,
477
+ {
478
+ ignoreStringArrays: true,
479
+ },
480
+ ],
481
+ "@typescript-eslint/restrict-plus-operands": [
482
+ ERROR,
483
+ {
484
+ allowAny: false,
485
+ allowBoolean: false,
486
+ allowNullish: false,
487
+ allowNumberAndString: false,
488
+ allowRegExp: false,
489
+ skipCompoundAssignments: false,
490
+ },
491
+ ],
492
+ "@typescript-eslint/restrict-template-expressions": [
493
+ ERROR,
494
+ {
495
+ allowAny: true,
496
+ allowArray: true,
497
+ allowBoolean: true,
498
+ allowNullish: false,
499
+ allowNumber: true,
500
+ allowNever: false,
501
+ allowRegExp: false,
502
+ }, /* investigate: make stricter */
503
+ ],
504
+ "@typescript-eslint/return-await": [ERROR, "in-try-catch"] /* BUG: doc incorrectly states that this extends the DEPRECATED (since 8.46) no-return-await: https://typescript-eslint.io/rules/return-await */,
505
+ "@typescript-eslint/strict-boolean-expressions": [
506
+ ERROR,
507
+ {
508
+ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
509
+ allowAny: false,
510
+ allowNumber: true,
511
+ allowString: false,
512
+ allowNullableBoolean: false,
513
+ allowNullableEnum: false,
514
+ allowNullableNumber: false,
515
+ allowNullableObject: false,
516
+ allowNullableString: false,
517
+ },
518
+ ], /* requires tsconfig: strictNullChecks */
519
+ "@typescript-eslint/switch-exhaustiveness-check": [
520
+ ERROR,
521
+ {
522
+ allowDefaultCaseForExhaustiveSwitch: false,
523
+ requireDefaultForNonUnion: true,
524
+ },
525
+ ],
526
+ "@typescript-eslint/triple-slash-reference": [
527
+ ERROR,
528
+ {
529
+ lib: Never /** always | never */,
530
+ path: Never /** always | never */,
531
+ types: Never /** always | never | prefer-import */,
532
+ },
533
+ ],
534
+ "@typescript-eslint/typedef": OFF /* tsconfig: { noImplicitAny, strictPropertyInitialization } */,
535
+ "@typescript-eslint/unbound-method": [
536
+ ERROR,
537
+ {
538
+ ignoreStatic: false,
539
+ },
540
+ ],
541
+ "@typescript-eslint/unified-signatures": [
542
+ ERROR,
543
+ {
544
+ ignoreDifferentlyNamedParameters: false,
545
+ },
546
+ ],
547
+ "@typescript-eslint/use-unknown-in-catch-callback-variable": ERROR,
548
+ },
549
+ ] as const;