1package eslint
2
3import (
4 "list"
5 "strings"
6 "time"
7 "struct"
8)
9
10#Plugins: {
11 @jsonschema(schema="http://json-schema.org/draft-07/schema#")
12 @jsonschema(id="https://json.schemastore.org/partial-eslint-plugins.json")
13
14 // Classes decorated with @Component must have suffix "Component" (or custom) in
15 // their name. See more at https://angular.dev/style-guide#style-02-03
16 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/component-class-suffix.md
17 "@angular-eslint/component-class-suffix"?: matchN(1, [
18 #ruleNumber,
19 #ruleString,
20 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
21 "suffixes"?: [...string]
22 ...
23 }, ...]
24 ])
25
26 // Enforces a maximum number of lines in inline template, styles and animations.
27 // See more at https://angular.dev/style-guide#style-05-04
28 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/component-max-inline-declarations.md
29 "@angular-eslint/component-max-inline-declarations"?: matchN(1, [
30 #ruleNumber,
31 #ruleString,
32 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
33 "template"?: >=0
34 "styles"?: >=0
35 "animations"?: >=0
36 ...
37 }, ...]
38 ])
39
40 // Component selectors should follow given naming rules. See more at
41 // https://angular.dev/style-guide#style-02-07,
42 // https://angular.dev/style-guide#style-05-02
43 // and https://angular.dev/style-guide#style-05-03.
44 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/component-selector.md
45 "@angular-eslint/component-selector"?: matchN(1, [
46 #ruleNumber,
47 #ruleString,
48 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
49 "type"?: matchN(1, [string, [..."element" | "attribute"]])
50 "prefix"?: string | [...]
51 "style"?: "camelCase" | "kebab-case"
52 ...
53 }, ...]
54 ])
55
56 // Ensures consistent usage of `styles`/`styleUrls`/`styleUrl` within Component metadata
57 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-component-styles.md
58 "@angular-eslint/consistent-component-styles"?: matchN(1, [
59 #ruleNumber,
60 #ruleString,
61 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
62 ])
63
64 // Ensures that classes use contextual decorators in its body
65 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/contextual-decorator.md
66 "@angular-eslint/contextual-decorator"?: _
67
68 // Ensures that lifecycle methods are used in a correct context
69 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/contextual-lifecycle.md
70 "@angular-eslint/contextual-lifecycle"?: _
71
72 // Classes decorated with @Directive must have suffix "Directive" (or custom) in
73 // their name. See more at https://angular.dev/style-guide#style-02-03
74 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/directive-class-suffix.md
75 "@angular-eslint/directive-class-suffix"?: matchN(1, [
76 #ruleNumber,
77 #ruleString,
78 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
79 "suffixes"?: [...string]
80 ...
81 }, ...]
82 ])
83
84 // Directive selectors should follow given naming rules. See more at
85 // https://angular.dev/style-guide#style-02-06 and
86 // https://angular.dev/style-guide#style-02-08.
87 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/directive-selector.md
88 "@angular-eslint/directive-selector"?: matchN(1, [
89 #ruleNumber,
90 #ruleString,
91 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
92 "type"?: matchN(1, [string, [..."element" | "attribute"]])
93 "prefix"?: string | [...]
94 "style"?: "camelCase" | "kebab-case"
95 ...
96 }, ...]
97 ])
98
99 // Angular Lifecycle methods should not be async. Angular does not wait for
100 // async lifecycle but the code incorrectly suggests it does.
101 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-async-lifecycle-method.md
102 "@angular-eslint/no-async-lifecycle-method"?: _
103
104 // The @Attribute decorator is used to obtain a single value for an attribute.
105 // This is a much less common use-case than getting a stream of values (using
106 // @Input), so often the @Attribute decorator is mistakenly used when @Input
107 // was what was intended. This rule disallows usage of @Attribute decorator
108 // altogether in order to prevent these mistakes.
109 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-attribute-decorator.md
110 "@angular-eslint/no-attribute-decorator"?: _
111
112 // Ensures that directives not implement conflicting lifecycle interfaces.
113 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-conflicting-lifecycle.md
114 "@angular-eslint/no-conflicting-lifecycle"?: _
115
116 // Ensures that metadata arrays do not contain duplicate entries.
117 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-duplicates-in-metadata-arrays.md
118 "@angular-eslint/no-duplicates-in-metadata-arrays"?: _
119
120 // Disallows declaring empty lifecycle methods
121 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-empty-lifecycle-method.md
122 "@angular-eslint/no-empty-lifecycle-method"?: _
123
124 // Disallows usage of `forwardRef` references for DI
125 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-forward-ref.md
126 "@angular-eslint/no-forward-ref"?: _
127
128 // Disallows usage of the `host` metadata property. NOTE: This used to be
129 // recommended by the Angular Team, but now they recommend the exact opposite:
130 // https://github.com/angular/angular/issues/54284
131 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-host-metadata-property.md
132 "@angular-eslint/no-host-metadata-property"?: matchN(1, [
133 #ruleNumber,
134 #ruleString,
135 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
136 "allowStatic"?: bool
137 ...
138 }, ...]
139 ])
140
141 // Ensures that input bindings, including aliases, are not named or prefixed by
142 // the configured disallowed prefixes
143 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-input-prefix.md
144 "@angular-eslint/no-input-prefix"?: matchN(1, [
145 #ruleNumber,
146 #ruleString,
147 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
148 "prefixes"?: [...string]
149 ...
150 }, ...]
151 ])
152
153 // Ensures that input bindings are not aliased
154 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-input-rename.md
155 "@angular-eslint/no-input-rename"?: matchN(1, [
156 #ruleNumber,
157 #ruleString,
158 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
159 // A list with allowed input names
160 "allowedNames"?: list.UniqueItems() & [...string]
161 ...
162 }, ...]
163 ])
164
165 // Disallows usage of the `inputs` metadata property. See more at
166 // https://angular.dev/style-guide#style-05-12
167 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-inputs-metadata-property.md
168 "@angular-eslint/no-inputs-metadata-property"?: _
169
170 // Disallows explicit calls to lifecycle methods
171 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-lifecycle-call.md
172 "@angular-eslint/no-lifecycle-call"?: _
173
174 // Ensures that output bindings, including aliases, are not named as standard DOM events
175 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-output-native.md
176 "@angular-eslint/no-output-native"?: _
177
178 // Ensures that output bindings, including aliases, are not named "on", nor
179 // prefixed with it. See more at https://angular.dev/style-guide#style-05-16
180 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-output-on-prefix.md
181 "@angular-eslint/no-output-on-prefix"?: _
182
183 // Ensures that output bindings are not aliased
184 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-output-rename.md
185 "@angular-eslint/no-output-rename"?: _
186
187 // Disallows usage of the `outputs` metadata property. See more at
188 // https://angular.dev/style-guide#style-05-12
189 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-outputs-metadata-property.md
190 "@angular-eslint/no-outputs-metadata-property"?: _
191
192 // Disallows the declaration of impure pipes
193 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-pipe-impure.md
194 "@angular-eslint/no-pipe-impure"?: _
195
196 // Disallows usage of the `queries` metadata property. See more at
197 // https://angular.dev/style-guide#style-05-12.
198 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-queries-metadata-property.md
199 "@angular-eslint/no-queries-metadata-property"?: _
200
201 // Enforce consistent prefix for pipes.
202 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/pipe-prefix.md
203 "@angular-eslint/pipe-prefix"?: matchN(1, [
204 #ruleNumber,
205 #ruleString,
206 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
207 "prefixes"?: list.UniqueItems() & [...string]
208 ...
209 }, ...]
210 ])
211
212 // Ensures component's `changeDetection` is set to `ChangeDetectionStrategy.OnPush`
213 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-on-push-component-change-detection.md
214 "@angular-eslint/prefer-on-push-component-change-detection"?: _
215
216 // Ensures component, directive and pipe `standalone` property is set to `true`
217 // in the component decorator
218 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-standalone.md
219 "@angular-eslint/prefer-standalone"?: _
220
221 // Ensures component `standalone` property is set to `true` in the component decorator
222 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-standalone-component.md
223 "@angular-eslint/prefer-standalone-component"?: _
224
225 // Prefer to declare `@Output` as `readonly` since they are not supposed to be reassigned
226 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-output-readonly.md
227 "@angular-eslint/prefer-output-readonly"?: _
228
229 // The ./ and ../ prefix is standard syntax for relative URLs; don't depend on
230 // Angular's current ability to do without that prefix. See more at
231 // https://angular.dev/style-guide#style-05-04
232 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/relative-url-prefix.md
233 "@angular-eslint/relative-url-prefix"?: _
234
235 // Ensures that $localize tagged messages contain helpful metadata to aid with translations.
236 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/require-localize-metadata.md
237 "@angular-eslint/require-localize-metadata"?: matchN(1, [
238 #ruleNumber,
239 #ruleString,
240 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
241 "requireDescription"?: bool
242 "requireMeaning"?: bool
243 ...
244 }, ...]
245 ])
246
247 // Ensures that lifecycle methods are declared in order of execution
248 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/sort-lifecycle-methods.md
249 "@angular-eslint/sort-lifecycle-methods"?: _
250
251 // Ensures ASC alphabetical order for `NgModule` metadata arrays for easy visual scanning
252 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/sort-ngmodule-metadata-arrays.md
253 "@angular-eslint/sort-ngmodule-metadata-arrays"?: matchN(1, [
254 #ruleNumber,
255 #ruleString,
256 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
257 // A string with a BCP 47 language tag.
258 "locale"?: string
259 ...
260 }, ...]
261 ])
262
263 // Component selector must be declared
264 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/use-component-selector.md
265 "@angular-eslint/use-component-selector"?: _
266
267 // Disallows using `ViewEncapsulation.None`
268 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/use-component-view-encapsulation.md
269 "@angular-eslint/use-component-view-encapsulation"?: _
270
271 // Using the `providedIn` property makes `Injectables` tree-shakable
272 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/use-injectable-provided-in.md
273 "@angular-eslint/use-injectable-provided-in"?: matchN(1, [
274 #ruleNumber,
275 #ruleString,
276 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
277 "ignoreClassNamePattern"?: string
278 ...
279 }, ...]
280 ])
281
282 // Ensures that classes implement lifecycle interfaces corresponding to the
283 // declared lifecycle methods. See more at
284 // https://angular.dev/style-guide#style-09-01
285 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/use-lifecycle-interface.md
286 "@angular-eslint/use-lifecycle-interface"?: _
287
288 // Ensures that `Pipes` implement `PipeTransform` interface
289 // https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/use-pipe-transform-interface.md
290 "@angular-eslint/use-pipe-transform-interface"?: _
291
292 // Ensure imports point to a file/module that can be resolved.
293 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-unresolved.md
294 "eslint-plugin-import/no-unresolved"?: matchN(1, [
295 #ruleNumber,
296 #ruleString,
297 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
298 "commonjs"?: bool
299 "amd"?: bool
300 "esmodule"?: bool
301 "ignore"?: list.MinItems(1) & list.UniqueItems() & [...string]
302 "caseSensitive"?: bool
303 "caseSensitiveStrict"?: bool
304 ...
305 }, ...]
306 ])
307
308 // Ensure named imports correspond to a named export in the remote file.
309 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/named.md
310 "eslint-plugin-import/named"?: matchN(1, [
311 #ruleNumber,
312 #ruleString,
313 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
314 "commonjs"?: bool
315 ...
316 }, ...]
317 ])
318
319 // Ensure a default export is present, given a default import.
320 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/default.md
321 "eslint-plugin-import/default"?: _
322
323 // Ensure imported namespaces contain dereferenced properties as they are dereferenced.
324 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/namespace.md
325 "eslint-plugin-import/namespace"?: matchN(1, [
326 #ruleNumber,
327 #ruleString,
328 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
329 // If `false`, will report computed (and thus, un-lintable) references to namespace members.
330 "allowComputed"?: bool
331 ...
332 }, ...]
333 ])
334
335 // Forbid namespace (a.k.a. "wildcard" `*`) imports.
336 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-namespace.md
337 "eslint-plugin-import/no-namespace"?: matchN(1, [
338 #ruleNumber,
339 #ruleString,
340 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
341 "ignore"?: list.UniqueItems() & [...string]
342 ...
343 }, ...]
344 ])
345
346 // Forbid any invalid exports, i.e. re-export of the same name.
347 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/export.md
348 "eslint-plugin-import/export"?: _
349
350 // Forbid the use of mutable exports with `var` or `let`.
351 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-mutable-exports.md
352 "eslint-plugin-import/no-mutable-exports"?: _
353
354 // Ensure consistent use of file extension within the import path.
355 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/extensions.md
356 "eslint-plugin-import/extensions"?: _
357
358 // Enforce which files can be imported in a given folder.
359 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-restricted-paths.md
360 "eslint-plugin-import/no-restricted-paths"?: matchN(1, [
361 #ruleNumber,
362 #ruleString,
363 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
364 "zones"?: list.MinItems(1) & [...close({
365 "target"?: matchN(>=1, [string, list.UniqueItems() & list.MinItems(1) & [...string]])
366 "from"?: matchN(>=1, [string, list.UniqueItems() & list.MinItems(1) & [...string]])
367 "except"?: list.UniqueItems() & [...string]
368 "message"?: string
369 })]
370 "basePath"?: string
371 ...
372 }, ...]
373 ])
374
375 // Forbid importing the submodules of other modules.
376 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-internal-modules.md
377 "eslint-plugin-import/no-internal-modules"?: matchN(1, [
378 #ruleNumber,
379 #ruleString,
380 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
381 ])
382
383 // Prefer named exports to be grouped together in a single export declaration
384 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/group-exports.md
385 "eslint-plugin-import/group-exports"?: _
386
387 // Forbid importing packages through relative paths.
388 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-relative-packages.md
389 "eslint-plugin-import/no-relative-packages"?: matchN(1, [
390 #ruleNumber,
391 #ruleString,
392 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
393 "commonjs"?: bool
394 "amd"?: bool
395 "esmodule"?: bool
396 "ignore"?: list.MinItems(1) & list.UniqueItems() & [...string]
397 ...
398 }, ...]
399 ])
400
401 // Forbid importing modules from parent directories.
402 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-relative-parent-imports.md
403 "eslint-plugin-import/no-relative-parent-imports"?: matchN(1, [
404 #ruleNumber,
405 #ruleString,
406 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
407 "commonjs"?: bool
408 "amd"?: bool
409 "esmodule"?: bool
410 "ignore"?: list.MinItems(1) & list.UniqueItems() & [...string]
411 ...
412 }, ...]
413 ])
414
415 // Enforce or ban the use of inline type-only markers for named imports.
416 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/consistent-type-specifier-style.md
417 "eslint-plugin-import/consistent-type-specifier-style"?: matchN(1, [
418 #ruleNumber,
419 #ruleString,
420 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
421 ])
422
423 // Forbid a module from importing itself.
424 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-self-import.md
425 "eslint-plugin-import/no-self-import"?: _
426
427 // Forbid a module from importing a module with a dependency path back to itself.
428 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-cycle.md
429 "eslint-plugin-import/no-cycle"?: matchN(1, [
430 #ruleNumber,
431 #ruleString,
432 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
433 "commonjs"?: bool
434 "amd"?: bool
435 "esmodule"?: bool
436 "ignore"?: list.MinItems(1) & list.UniqueItems() & [...string]
437 "maxDepth"?: matchN(>=1, [int & >=1, "∞"])
438
439 // ignore external modules
440 "ignoreExternal"?: bool
441
442 // Allow cyclic dependency if there is at least one dynamic import in the chain
443 "allowUnsafeDynamicCyclicDependency"?: bool
444 ...
445 }, ...]
446 ])
447
448 // Forbid named default exports.
449 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-named-default.md
450 "eslint-plugin-import/no-named-default"?: _
451
452 // Forbid use of exported name as identifier of default export.
453 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-named-as-default.md
454 "eslint-plugin-import/no-named-as-default"?: _
455
456 // Forbid use of exported name as property of default export.
457 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-named-as-default-member.md
458 "eslint-plugin-import/no-named-as-default-member"?: _
459
460 // Forbid anonymous values as default exports.
461 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-anonymous-default-export.md
462 "eslint-plugin-import/no-anonymous-default-export"?: matchN(1, [
463 #ruleNumber,
464 #ruleString,
465 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
466 // If `false`, will report default export of an array
467 "allowArray"?: bool
468
469 // If `false`, will report default export of an arrow function
470 "allowArrowFunction"?: bool
471
472 // If `false`, will report default export of a function call
473 "allowCallExpression"?: bool
474
475 // If `false`, will report default export of an anonymous class
476 "allowAnonymousClass"?: bool
477
478 // If `false`, will report default export of an anonymous function
479 "allowAnonymousFunction"?: bool
480
481 // If `false`, will report default export of a literal
482 "allowLiteral"?: bool
483
484 // If `false`, will report default export of an object expression
485 "allowObject"?: bool
486
487 // If `false`, will report default export of a class instantiation
488 "allowNew"?: bool
489 ...
490 }, ...]
491 ])
492
493 // Forbid modules without exports, or exports without matching import in another module.
494 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-unused-modules.md
495 "eslint-plugin-import/no-unused-modules"?: matchN(1, [
496 #ruleNumber,
497 #ruleString,
498 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
499 // files/paths to be analyzed (only for unused exports)
500 "src"?: list.UniqueItems() & [...strings.MinRunes(1)]
501
502 // files/paths for which unused exports will not be reported (e.g module entry points)
503 "ignoreExports"?: list.UniqueItems() & [...strings.MinRunes(1)]
504
505 // report modules without any exports
506 "missingExports"?: bool
507
508 // report exports without any usage
509 "unusedExports"?: bool
510 ...
511 }, ...]
512 ])
513
514 // Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
515 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-commonjs.md
516 "eslint-plugin-import/no-commonjs"?: _
517
518 // Forbid AMD `require` and `define` calls.
519 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-amd.md
520 "eslint-plugin-import/no-amd"?: _
521
522 // Forbid repeated import of the same module in multiple places.
523 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-duplicates.md
524 "eslint-plugin-import/no-duplicates"?: matchN(1, [
525 #ruleNumber,
526 #ruleString,
527 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
528 "considerQueryString"?: bool
529 "prefer-inline"?: bool
530 ...
531 }, ...]
532 ])
533
534 // Ensure all imports appear before other statements.
535 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/first.md
536 "eslint-plugin-import/first"?: matchN(1, [
537 #ruleNumber,
538 #ruleString,
539 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
540 ])
541
542 // Enforce the maximum number of dependencies a module can have.
543 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/max-dependencies.md
544 "eslint-plugin-import/max-dependencies"?: matchN(1, [
545 #ruleNumber,
546 #ruleString,
547 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
548 "max"?: number
549 "ignoreTypeImports"?: bool
550 ...
551 }, ...]
552 ])
553
554 // Forbid the use of extraneous packages.
555 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-extraneous-dependencies.md
556 "eslint-plugin-import/no-extraneous-dependencies"?: matchN(1, [
557 #ruleNumber,
558 #ruleString,
559 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
560 "devDependencies"?: matchN(1, [bool, [..._]])
561 "optionalDependencies"?: matchN(1, [bool, [..._]])
562 "peerDependencies"?: matchN(1, [bool, [..._]])
563 "bundledDependencies"?: matchN(1, [bool, [..._]])
564 "packageDir"?: matchN(1, [string, [..._]])
565 "includeInternal"?: bool
566 "includeTypes"?: bool
567 ...
568 }, ...]
569 ])
570
571 // Forbid import of modules using absolute paths.
572 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-absolute-path.md
573 "eslint-plugin-import/no-absolute-path"?: matchN(1, [
574 #ruleNumber,
575 #ruleString,
576 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
577 "commonjs"?: bool
578 "amd"?: bool
579 "esmodule"?: bool
580 "ignore"?: list.MinItems(1) & list.UniqueItems() & [...string]
581 ...
582 }, ...]
583 ])
584
585 // Forbid Node.js builtin modules.
586 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-nodejs-modules.md
587 "eslint-plugin-import/no-nodejs-modules"?: matchN(1, [
588 #ruleNumber,
589 #ruleString,
590 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
591 "allow"?: list.UniqueItems() & [...string]
592 ...
593 }, ...]
594 ])
595
596 // Forbid webpack loader syntax in imports.
597 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-webpack-loader-syntax.md
598 "eslint-plugin-import/no-webpack-loader-syntax"?: _
599
600 // Enforce a convention in module import order.
601 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/order.md
602 "eslint-plugin-import/order"?: matchN(1, [
603 #ruleNumber,
604 #ruleString,
605 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
606 "groups"?: [...]
607 "pathGroupsExcludedImportTypes"?: [...]
608 "distinctGroup"?: bool
609 "pathGroups"?: [...close({
610 "pattern"!: string
611 "patternOptions"?: {...}
612 "group"!: "builtin" |
613 "external" |
614 "internal" |
615 "unknown" |
616 "parent" |
617 "sibling" |
618 "index" |
619 "object" |
620 "type"
621 "position"?: "after" | "before"
622 })]
623 "newlines-between"?: "ignore" | "always" | "always-and-inside-groups" | "never"
624 "alphabetize"?: close({
625 "caseInsensitive"?: bool
626 "order"?: "ignore" | "asc" | "desc"
627 "orderImportKind"?: "ignore" | "asc" | "desc"
628 })
629 "warnOnUnassignedImports"?: bool
630 ...
631 }, ...]
632 ])
633
634 // Enforce a newline after import statements.
635 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/newline-after-import.md
636 "eslint-plugin-import/newline-after-import"?: matchN(1, [
637 #ruleNumber,
638 #ruleString,
639 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
640 "count"?: int & >=1
641 "exactCount"?: bool
642 "considerComments"?: bool
643 ...
644 }, ...]
645 ])
646
647 // Prefer a default export if module exports a single name or multiple names.
648 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/prefer-default-export.md
649 "eslint-plugin-import/prefer-default-export"?: matchN(1, [
650 #ruleNumber,
651 #ruleString,
652 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
653 "target"?: "single" | "any"
654 ...
655 }, ...]
656 ])
657
658 // Forbid default exports.
659 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-default-export.md
660 "eslint-plugin-import/no-default-export"?: _
661
662 // Forbid named exports.
663 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-named-export.md
664 "eslint-plugin-import/no-named-export"?: _
665
666 // Forbid `require()` calls with expressions.
667 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-dynamic-require.md
668 "eslint-plugin-import/no-dynamic-require"?: matchN(1, [
669 #ruleNumber,
670 #ruleString,
671 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
672 "esmodule"?: bool
673 ...
674 }, ...]
675 ])
676
677 // Forbid potentially ambiguous parse goal (`script` vs. `module`).
678 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/unambiguous.md
679 "eslint-plugin-import/unambiguous"?: _
680
681 // Forbid unassigned imports
682 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-unassigned-import.md
683 "eslint-plugin-import/no-unassigned-import"?: matchN(1, [
684 #ruleNumber,
685 #ruleString,
686 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
687 "devDependencies"?: matchN(1, [bool, [..._]])
688 "optionalDependencies"?: matchN(1, [bool, [..._]])
689 "peerDependencies"?: matchN(1, [bool, [..._]])
690 "allow"?: [...string]
691 ...
692 }, ...]
693 ])
694
695 // Forbid unnecessary path segments in import and require statements.
696 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-useless-path-segments.md
697 "eslint-plugin-import/no-useless-path-segments"?: matchN(1, [
698 #ruleNumber,
699 #ruleString,
700 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
701 "commonjs"?: bool
702 "noUselessIndex"?: bool
703 ...
704 }, ...]
705 ])
706
707 // Enforce a leading comment with the webpackChunkName for dynamic imports.
708 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/dynamic-import-chunkname.md
709 "eslint-plugin-import/dynamic-import-chunkname"?: matchN(1, [
710 #ruleNumber,
711 #ruleString,
712 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
713 "importFunctions"?: list.UniqueItems() & [...string]
714 "webpackChunknameFormat"?: string
715 ...
716 }, ...]
717 ])
718
719 // Forbid import statements with CommonJS module.exports.
720 "eslint-plugin-import/no-import-module-exports"?: matchN(1, [
721 #ruleNumber,
722 #ruleString,
723 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
724 "exceptions"?: [...]
725 ...
726 }, ...]
727 ])
728
729 // Forbid empty named import blocks.
730 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-empty-named-blocks.md
731 "eslint-plugin-import/no-empty-named-blocks"?: _
732
733 // Ensure all exports appear after other statements.
734 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/exports-last.md
735 "eslint-plugin-import/exports-last"?: _
736
737 // Forbid imported names marked with `@deprecated` documentation tag.
738 // https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-deprecated.md
739 "eslint-plugin-import/no-deprecated"?: _
740
741 // Replaced by `import/first`.
742 // https://github.com/import-js/eslint-plugin-import/blob/7b25c1cb95ee18acc1531002fd343e1e6031f9ed/docs/rules/imports-first.md
743 "eslint-plugin-import/imports-first"?: matchN(1, [
744 #ruleNumber,
745 #ruleString,
746 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
747 ])
748
749 // Improve regexes by making them shorter, consistent, and safer.
750 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/better-regex.md
751 "eslint-plugin-unicorn/better-regex"?: matchN(1, [
752 #ruleNumber,
753 #ruleString,
754 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
755 "sortCharacterClasses"?: bool
756 ...
757 }, ...]
758 ])
759
760 // Enforce a specific parameter name in catch clauses.
761 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/catch-error-name.md
762 "eslint-plugin-unicorn/catch-error-name"?: matchN(1, [
763 #ruleNumber,
764 #ruleString,
765 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
766 "name"?: string
767 "ignore"?: list.UniqueItems()
768 ...
769 }, ...]
770 ])
771
772 // Use destructured variables over properties.
773 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/consistent-destructuring.md
774 "eslint-plugin-unicorn/consistent-destructuring"?: _
775
776 // Prefer consistent types when spreading a ternary in an array literal.
777 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/consistent-empty-array-spread.md
778 "eslint-plugin-unicorn/consistent-empty-array-spread"?: _
779
780 // Move function definitions to the highest possible scope.
781 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/consistent-function-scoping.md
782 "eslint-plugin-unicorn/consistent-function-scoping"?: matchN(1, [
783 #ruleNumber,
784 #ruleString,
785 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
786 "checkArrowFunctions"?: bool
787 ...
788 }, ...]
789 ])
790
791 // Enforce correct `Error` subclassing.
792 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/custom-error-definition.md
793 "eslint-plugin-unicorn/custom-error-definition"?: _
794
795 // Enforce no spaces between braces.
796 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/empty-brace-spaces.md
797 "eslint-plugin-unicorn/empty-brace-spaces"?: _
798
799 // Enforce passing a `message` value when creating a built-in error.
800 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/error-message.md
801 "eslint-plugin-unicorn/error-message"?: _
802
803 // Require escape sequences to use uppercase values.
804 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/escape-case.md
805 "eslint-plugin-unicorn/escape-case"?: _
806
807 // Add expiration conditions to TODO comments.
808 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/expiring-todo-comments.md
809 "eslint-plugin-unicorn/expiring-todo-comments"?: matchN(1, [
810 #ruleNumber,
811 #ruleString,
812 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
813 "terms"?: [...string]
814 "ignore"?: list.UniqueItems()
815 "ignoreDatesOnPullRequests"?: bool
816 "allowWarningComments"?: bool
817 "date"?: time.Format("2006-01-02")
818 ...
819 }, ...]
820 ])
821
822 // Enforce explicitly comparing the `length` or `size` property of a value.
823 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/explicit-length-check.md
824 "eslint-plugin-unicorn/explicit-length-check"?: matchN(1, [
825 #ruleNumber,
826 #ruleString,
827 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
828 "non-zero"?: "greater-than" | "not-equal"
829 ...
830 }, ...]
831 ])
832
833 // Enforce a case style for filenames.
834 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/filename-case.md
835 "eslint-plugin-unicorn/filename-case"?: matchN(1, [
836 #ruleNumber,
837 #ruleString,
838 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
839 ])
840
841 // Enforce specific import styles per module.
842 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/import-style.md
843 "eslint-plugin-unicorn/import-style"?: _
844
845 // Enforce the use of `new` for all builtins, except `String`, `Number`,
846 // `Boolean`, `Symbol` and `BigInt`.
847 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/new-for-builtins.md
848 "eslint-plugin-unicorn/new-for-builtins"?: _
849
850 // Enforce specifying rules to disable in `eslint-disable` comments.
851 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-abusive-eslint-disable.md
852 "eslint-plugin-unicorn/no-abusive-eslint-disable"?: _
853
854 // Disallow anonymous functions and classes as the default export.
855 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-anonymous-default-export.md
856 "eslint-plugin-unicorn/no-anonymous-default-export"?: _
857
858 // Prevent passing a function reference directly to iterator methods.
859 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-array-callback-reference.md
860 "eslint-plugin-unicorn/no-array-callback-reference"?: _
861
862 // Prefer `for…of` over the `forEach` method.
863 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-array-for-each.md
864 "eslint-plugin-unicorn/no-array-for-each"?: _
865
866 // Disallow using the `this` argument in array methods.
867 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-array-method-this-argument.md
868 "eslint-plugin-unicorn/no-array-method-this-argument"?: _
869
870 // Enforce combining multiple `Array#push()` into one call.
871 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-array-push-push.md
872 "eslint-plugin-unicorn/no-array-push-push"?: matchN(1, [
873 #ruleNumber,
874 #ruleString,
875 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
876 "ignore"?: list.UniqueItems()
877 ...
878 }, ...]
879 ])
880
881 // Disallow `Array#reduce()` and `Array#reduceRight()`.
882 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-array-reduce.md
883 "eslint-plugin-unicorn/no-array-reduce"?: matchN(1, [
884 #ruleNumber,
885 #ruleString,
886 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
887 "allowSimpleOperations"?: bool
888 ...
889 }, ...]
890 ])
891
892 // Disallow member access from await expression.
893 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-await-expression-member.md
894 "eslint-plugin-unicorn/no-await-expression-member"?: _
895
896 // Disallow using `await` in `Promise` method parameters.
897 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-await-in-promise-methods.md
898 "eslint-plugin-unicorn/no-await-in-promise-methods"?: _
899
900 // Do not use leading/trailing space between `console.log` parameters.
901 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-console-spaces.md
902 "eslint-plugin-unicorn/no-console-spaces"?: _
903
904 // Do not use `document.cookie` directly.
905 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-document-cookie.md
906 "eslint-plugin-unicorn/no-document-cookie"?: _
907
908 // Disallow empty files.
909 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-empty-file.md
910 "eslint-plugin-unicorn/no-empty-file"?: _
911
912 // Do not use a `for` loop that can be replaced with a `for-of` loop.
913 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-for-loop.md
914 "eslint-plugin-unicorn/no-for-loop"?: _
915
916 // Enforce the use of Unicode escapes instead of hexadecimal escapes.
917 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-hex-escape.md
918 "eslint-plugin-unicorn/no-hex-escape"?: _
919
920 // Require `Array.isArray()` instead of `instanceof Array`.
921 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-instanceof-array.md
922 "eslint-plugin-unicorn/no-instanceof-array"?: _
923
924 // Disallow invalid options in `fetch()` and `new Request()`.
925 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-invalid-fetch-options.md
926 "eslint-plugin-unicorn/no-invalid-fetch-options"?: _
927
928 // Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
929 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-invalid-remove-event-listener.md
930 "eslint-plugin-unicorn/no-invalid-remove-event-listener"?: _
931
932 // Disallow identifiers starting with `new` or `class`.
933 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-keyword-prefix.md
934 "eslint-plugin-unicorn/no-keyword-prefix"?: matchN(1, [
935 #ruleNumber,
936 #ruleString,
937 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
938 "disallowedPrefixes"?: list.UniqueItems() & list.MaxItems(1) & [string, ...]
939 "checkProperties"?: bool
940 "onlyCamelCase"?: bool
941 ...
942 }, ...]
943 ])
944
945 // Disallow `if` statements as the only statement in `if` blocks without `else`.
946 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-lonely-if.md
947 "eslint-plugin-unicorn/no-lonely-if"?: _
948
949 // Disallow a magic number as the `depth` argument in `Array#flat(…).`
950 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-magic-array-flat-depth.md
951 "eslint-plugin-unicorn/no-magic-array-flat-depth"?: _
952
953 // Disallow negated conditions.
954 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-negated-condition.md
955 "eslint-plugin-unicorn/no-negated-condition"?: _
956
957 // Disallow negated expression in equality check.
958 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-negation-in-equality-check.md
959 "eslint-plugin-unicorn/no-negation-in-equality-check"?: _
960
961 // Disallow nested ternary expressions.
962 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-nested-ternary.md
963 "eslint-plugin-unicorn/no-nested-ternary"?: _
964
965 // Disallow `new Array()`.
966 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-new-array.md
967 "eslint-plugin-unicorn/no-new-array"?: _
968
969 // Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
970 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-new-buffer.md
971 "eslint-plugin-unicorn/no-new-buffer"?: _
972
973 // Disallow the use of the `null` literal.
974 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-null.md
975 "eslint-plugin-unicorn/no-null"?: matchN(1, [
976 #ruleNumber,
977 #ruleString,
978 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
979 "checkStrictEquality"?: bool
980 ...
981 }, ...]
982 ])
983
984 // Disallow the use of objects as default parameters.
985 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-object-as-default-parameter.md
986 "eslint-plugin-unicorn/no-object-as-default-parameter"?: _
987
988 // Disallow `process.exit()`.
989 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-process-exit.md
990 "eslint-plugin-unicorn/no-process-exit"?: _
991
992 // Disallow passing single-element arrays to `Promise` methods.
993 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-single-promise-in-promise-methods.md
994 "eslint-plugin-unicorn/no-single-promise-in-promise-methods"?: _
995
996 // Disallow classes that only have static members.
997 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-static-only-class.md
998 "eslint-plugin-unicorn/no-static-only-class"?: _
999
1000 // Disallow `then` property.
1001 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-thenable.md
1002 "eslint-plugin-unicorn/no-thenable"?: _
1003
1004 // Disallow assigning `this` to a variable.
1005 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-this-assignment.md
1006 "eslint-plugin-unicorn/no-this-assignment"?: _
1007
1008 // Disallow comparing `undefined` using `typeof`.
1009 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-typeof-undefined.md
1010 "eslint-plugin-unicorn/no-typeof-undefined"?: matchN(1, [
1011 #ruleNumber,
1012 #ruleString,
1013 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1014 "checkGlobalVariables"?: bool
1015 ...
1016 }, ...]
1017 ])
1018
1019 // Disallow awaiting non-promise values.
1020 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-unnecessary-await.md
1021 "eslint-plugin-unicorn/no-unnecessary-await"?: _
1022
1023 // Enforce the use of built-in methods instead of unnecessary polyfills.
1024 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-unnecessary-polyfills.md
1025 "eslint-plugin-unicorn/no-unnecessary-polyfills"?: matchN(1, [
1026 #ruleNumber,
1027 #ruleString,
1028 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1029 "targets"?: string | [...] | {...}
1030 ...
1031 }, ...]
1032 ])
1033
1034 // Disallow unreadable array destructuring.
1035 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-unreadable-array-destructuring.md
1036 "eslint-plugin-unicorn/no-unreadable-array-destructuring"?: _
1037
1038 // Disallow unreadable IIFEs.
1039 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-unreadable-iife.md
1040 "eslint-plugin-unicorn/no-unreadable-iife"?: _
1041
1042 // Disallow unused object properties.
1043 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-unused-properties.md
1044 "eslint-plugin-unicorn/no-unused-properties"?: _
1045
1046 // Disallow useless fallback when spreading in object literals.
1047 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-useless-fallback-in-spread.md
1048 "eslint-plugin-unicorn/no-useless-fallback-in-spread"?: _
1049
1050 // Disallow useless array length check.
1051 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-useless-length-check.md
1052 "eslint-plugin-unicorn/no-useless-length-check"?: _
1053
1054 // Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
1055 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-useless-promise-resolve-reject.md
1056 "eslint-plugin-unicorn/no-useless-promise-resolve-reject"?: _
1057
1058 // Disallow unnecessary spread.
1059 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-useless-spread.md
1060 "eslint-plugin-unicorn/no-useless-spread"?: _
1061
1062 // Disallow useless case in switch statements.
1063 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-useless-switch-case.md
1064 "eslint-plugin-unicorn/no-useless-switch-case"?: _
1065
1066 // Disallow useless `undefined`.
1067 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-useless-undefined.md
1068 "eslint-plugin-unicorn/no-useless-undefined"?: matchN(1, [
1069 #ruleNumber,
1070 #ruleString,
1071 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1072 "checkArguments"?: bool
1073 "checkArrowFunctionBody"?: bool
1074 ...
1075 }, ...]
1076 ])
1077
1078 // Disallow number literals with zero fractions or dangling dots.
1079 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/no-zero-fractions.md
1080 "eslint-plugin-unicorn/no-zero-fractions"?: _
1081
1082 // Enforce proper case for numeric literals.
1083 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/number-literal-case.md
1084 "eslint-plugin-unicorn/number-literal-case"?: _
1085
1086 // Enforce the style of numeric separators by correctly grouping digits.
1087 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/numeric-separators-style.md
1088 "eslint-plugin-unicorn/numeric-separators-style"?: matchN(1, [
1089 #ruleNumber,
1090 #ruleString,
1091 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1092 "binary"?: close({
1093 "onlyIfContainsSeparator"?: bool
1094 "minimumDigits"?: int & >=0
1095 "groupLength"?: int & >=1
1096 })
1097 "octal"?: close({
1098 "onlyIfContainsSeparator"?: bool
1099 "minimumDigits"?: int & >=0
1100 "groupLength"?: int & >=1
1101 })
1102 "hexadecimal"?: close({
1103 "onlyIfContainsSeparator"?: bool
1104 "minimumDigits"?: int & >=0
1105 "groupLength"?: int & >=1
1106 })
1107 "number"?: close({
1108 "onlyIfContainsSeparator"?: bool
1109 "minimumDigits"?: int & >=0
1110 "groupLength"?: int & >=1
1111 })
1112 "onlyIfContainsSeparator"?: bool
1113 ...
1114 }, ...]
1115 ])
1116
1117 // Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
1118 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-add-event-listener.md
1119 "eslint-plugin-unicorn/prefer-add-event-listener"?: matchN(1, [
1120 #ruleNumber,
1121 #ruleString,
1122 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1123 "excludedPackages"?: list.UniqueItems() & [...string]
1124 ...
1125 }, ...]
1126 ])
1127
1128 // Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
1129 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-array-find.md
1130 "eslint-plugin-unicorn/prefer-array-find"?: matchN(1, [
1131 #ruleNumber,
1132 #ruleString,
1133 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1134 "checkFromLast"?: bool
1135 ...
1136 }, ...]
1137 ])
1138
1139 // Prefer `.flatMap(…)` over `.map(…).flat()`.
1140 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-array-flat-map.md
1141 "eslint-plugin-unicorn/prefer-array-flat-map"?: _
1142
1143 // Prefer `Array#flat()` over legacy techniques to flatten arrays.
1144 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-array-flat.md
1145 "eslint-plugin-unicorn/prefer-array-flat"?: matchN(1, [
1146 #ruleNumber,
1147 #ruleString,
1148 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1149 "functions"?: list.UniqueItems()
1150 ...
1151 }, ...]
1152 ])
1153
1154 // Prefer `Array#{indexOf,lastIndexOf}()` over
1155 // `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
1156 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-array-index-of.md
1157 "eslint-plugin-unicorn/prefer-array-index-of"?: _
1158
1159 // Prefer `.some(…)` over `.filter(…).length` check and
1160 // `.{find,findLast,findIndex,findLastIndex}(…)`.
1161 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-array-some.md
1162 "eslint-plugin-unicorn/prefer-array-some"?: _
1163
1164 // Prefer `.at()` method for index access and `String#charAt()`.
1165 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-at.md
1166 "eslint-plugin-unicorn/prefer-at"?: matchN(1, [
1167 #ruleNumber,
1168 #ruleString,
1169 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1170 "getLastElementFunctions"?: list.UniqueItems()
1171 "checkAllIndexAccess"?: bool
1172 ...
1173 }, ...]
1174 ])
1175
1176 // Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and
1177 // `Blob#text()` over `FileReader#readAsText(…)`.
1178 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-blob-reading-methods.md
1179 "eslint-plugin-unicorn/prefer-blob-reading-methods"?: _
1180
1181 // Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and
1182 // `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
1183 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-code-point.md
1184 "eslint-plugin-unicorn/prefer-code-point"?: _
1185
1186 // Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
1187 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-date-now.md
1188 "eslint-plugin-unicorn/prefer-date-now"?: _
1189
1190 // Prefer default parameters over reassignment.
1191 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-default-parameters.md
1192 "eslint-plugin-unicorn/prefer-default-parameters"?: _
1193
1194 // Prefer `Node#append()` over `Node#appendChild()`.
1195 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-dom-node-append.md
1196 "eslint-plugin-unicorn/prefer-dom-node-append"?: _
1197
1198 // Prefer using `.dataset` on DOM elements over calling attribute methods.
1199 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-dom-node-dataset.md
1200 "eslint-plugin-unicorn/prefer-dom-node-dataset"?: _
1201
1202 // Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
1203 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-dom-node-remove.md
1204 "eslint-plugin-unicorn/prefer-dom-node-remove"?: _
1205
1206 // Prefer `.textContent` over `.innerText`.
1207 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-dom-node-text-content.md
1208 "eslint-plugin-unicorn/prefer-dom-node-text-content"?: _
1209
1210 // Prefer `EventTarget` over `EventEmitter`.
1211 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-event-target.md
1212 "eslint-plugin-unicorn/prefer-event-target"?: _
1213
1214 // Prefer `export…from` when re-exporting.
1215 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-export-from.md
1216 "eslint-plugin-unicorn/prefer-export-from"?: matchN(1, [
1217 #ruleNumber,
1218 #ruleString,
1219 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1220 "ignoreUsedVariables"?: bool
1221 ...
1222 }, ...]
1223 ])
1224
1225 // Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()`
1226 // when checking for existence or non-existence.
1227 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-includes.md
1228 "eslint-plugin-unicorn/prefer-includes"?: _
1229
1230 // Prefer reading a JSON file as a buffer.
1231 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-json-parse-buffer.md
1232 "eslint-plugin-unicorn/prefer-json-parse-buffer"?: _
1233
1234 // Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`.
1235 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-keyboard-event-key.md
1236 "eslint-plugin-unicorn/prefer-keyboard-event-key"?: _
1237
1238 // Prefer using a logical operator over a ternary.
1239 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-logical-operator-over-ternary.md
1240 "eslint-plugin-unicorn/prefer-logical-operator-over-ternary"?: _
1241
1242 // Enforce the use of `Math.trunc` instead of bitwise operators.
1243 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-math-trunc.md
1244 "eslint-plugin-unicorn/prefer-math-trunc"?: _
1245
1246 // Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over
1247 // `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or
1248 // `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
1249 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-modern-dom-apis.md
1250 "eslint-plugin-unicorn/prefer-modern-dom-apis"?: _
1251
1252 // Prefer modern `Math` APIs over legacy patterns.
1253 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-modern-math-apis.md
1254 "eslint-plugin-unicorn/prefer-modern-math-apis"?: _
1255
1256 // Prefer JavaScript modules (ESM) over CommonJS.
1257 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-module.md
1258 "eslint-plugin-unicorn/prefer-module"?: _
1259
1260 // Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
1261 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-native-coercion-functions.md
1262 "eslint-plugin-unicorn/prefer-native-coercion-functions"?: _
1263
1264 // Prefer negative index over `.length - index` when possible.
1265 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-negative-index.md
1266 "eslint-plugin-unicorn/prefer-negative-index"?: _
1267
1268 // Prefer using the `node:` protocol when importing Node.js builtin modules.
1269 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-node-protocol.md
1270 "eslint-plugin-unicorn/prefer-node-protocol"?: _
1271
1272 // Prefer `Number` static properties over global ones.
1273 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-number-properties.md
1274 "eslint-plugin-unicorn/prefer-number-properties"?: matchN(1, [
1275 #ruleNumber,
1276 #ruleString,
1277 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1278 "checkInfinity"?: bool
1279 "checkNaN"?: bool
1280 ...
1281 }, ...]
1282 ])
1283
1284 // Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
1285 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-object-from-entries.md
1286 "eslint-plugin-unicorn/prefer-object-from-entries"?: matchN(1, [
1287 #ruleNumber,
1288 #ruleString,
1289 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1290 "functions"?: list.UniqueItems()
1291 ...
1292 }, ...]
1293 ])
1294
1295 // Prefer omitting the `catch` binding parameter.
1296 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-optional-catch-binding.md
1297 "eslint-plugin-unicorn/prefer-optional-catch-binding"?: _
1298
1299 // Prefer borrowing methods from the prototype instead of the instance.
1300 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-prototype-methods.md
1301 "eslint-plugin-unicorn/prefer-prototype-methods"?: _
1302
1303 // Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()`
1304 // over `.getElementsByClassName()` and `.getElementsByTagName()`.
1305 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-query-selector.md
1306 "eslint-plugin-unicorn/prefer-query-selector"?: _
1307
1308 // Prefer `Reflect.apply()` over `Function#apply()`.
1309 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-reflect-apply.md
1310 "eslint-plugin-unicorn/prefer-reflect-apply"?: _
1311
1312 // Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
1313 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-regexp-test.md
1314 "eslint-plugin-unicorn/prefer-regexp-test"?: _
1315
1316 // Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
1317 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-set-has.md
1318 "eslint-plugin-unicorn/prefer-set-has"?: _
1319
1320 // Prefer using `Set#size` instead of `Array#length`.
1321 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-set-size.md
1322 "eslint-plugin-unicorn/prefer-set-size"?: _
1323
1324 // Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`,
1325 // `Array#{slice,toSpliced}()` and `String#split('')`.
1326 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-spread.md
1327 "eslint-plugin-unicorn/prefer-spread"?: _
1328
1329 // Prefer using the `String.raw` tag to avoid escaping `\`.
1330 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-string-raw.md
1331 "eslint-plugin-unicorn/prefer-string-raw"?: _
1332
1333 // Prefer `String#replaceAll()` over regex searches with the global flag.
1334 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-string-replace-all.md
1335 "eslint-plugin-unicorn/prefer-string-replace-all"?: _
1336
1337 // Prefer `String#slice()` over `String#substr()` and `String#substring()`.
1338 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-string-slice.md
1339 "eslint-plugin-unicorn/prefer-string-slice"?: _
1340
1341 // Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
1342 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-string-starts-ends-with.md
1343 "eslint-plugin-unicorn/prefer-string-starts-ends-with"?: _
1344
1345 // Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
1346 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-string-trim-start-end.md
1347 "eslint-plugin-unicorn/prefer-string-trim-start-end"?: _
1348
1349 // Prefer using `structuredClone` to create a deep clone.
1350 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-structured-clone.md
1351 "eslint-plugin-unicorn/prefer-structured-clone"?: matchN(1, [
1352 #ruleNumber,
1353 #ruleString,
1354 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1355 "functions"?: list.UniqueItems()
1356 ...
1357 }, ...]
1358 ])
1359
1360 // Prefer `switch` over multiple `else-if`.
1361 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-switch.md
1362 "eslint-plugin-unicorn/prefer-switch"?: matchN(1, [
1363 #ruleNumber,
1364 #ruleString,
1365 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1366 "minimumCases"?: int & >=2
1367 "emptyDefaultCase"?: "no-default-comment" | "do-nothing-comment" | "no-default-case"
1368 ...
1369 }, ...]
1370 ])
1371
1372 // Prefer ternary expressions over simple `if-else` statements.
1373 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-ternary.md
1374 "eslint-plugin-unicorn/prefer-ternary"?: matchN(1, [
1375 #ruleNumber,
1376 #ruleString,
1377 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1378 ])
1379
1380 // Prefer top-level await over top-level promises and async function calls.
1381 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-top-level-await.md
1382 "eslint-plugin-unicorn/prefer-top-level-await"?: _
1383
1384 // Enforce throwing `TypeError` in type checking conditions.
1385 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prefer-type-error.md
1386 "eslint-plugin-unicorn/prefer-type-error"?: _
1387
1388 // Prevent abbreviations.
1389 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/prevent-abbreviations.md
1390 "eslint-plugin-unicorn/prevent-abbreviations"?: _
1391
1392 // Enforce consistent relative URL style.
1393 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/relative-url-style.md
1394 "eslint-plugin-unicorn/relative-url-style"?: matchN(1, [
1395 #ruleNumber,
1396 #ruleString,
1397 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1398 ])
1399
1400 // Enforce using the separator argument with `Array#join()`.
1401 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/require-array-join-separator.md
1402 "eslint-plugin-unicorn/require-array-join-separator"?: _
1403
1404 // Enforce using the digits argument with `Number#toFixed()`.
1405 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/require-number-to-fixed-digits-argument.md
1406 "eslint-plugin-unicorn/require-number-to-fixed-digits-argument"?: _
1407
1408 // Enforce using the `targetOrigin` argument with `window.postMessage()`.
1409 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/require-post-message-target-origin.md
1410 "eslint-plugin-unicorn/require-post-message-target-origin"?: _
1411
1412 // Enforce better string content.
1413 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/string-content.md
1414 "eslint-plugin-unicorn/string-content"?: matchN(1, [
1415 #ruleNumber,
1416 #ruleString,
1417 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1418 "patterns"?: [string]: matchN(>=1, [
1419 string,
1420 close({
1421 "suggest"!: string
1422 "fix"?: bool
1423 "message"?: string
1424 })
1425 ])
1426 ...
1427 }, ...]
1428 ])
1429
1430 // Enforce consistent brace style for `case` clauses.
1431 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/switch-case-braces.md
1432 "eslint-plugin-unicorn/switch-case-braces"?: matchN(1, [
1433 #ruleNumber,
1434 #ruleString,
1435 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1436 ])
1437
1438 // Fix whitespace-insensitive template indentation.
1439 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/template-indent.md
1440 "eslint-plugin-unicorn/template-indent"?: matchN(1, [
1441 #ruleNumber,
1442 #ruleString,
1443 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1444 "indent"?: matchN(1, [=~"^\\s+$", int & >=1])
1445 "tags"?: list.UniqueItems() & [...string]
1446 "functions"?: list.UniqueItems() & [...string]
1447 "selectors"?: list.UniqueItems() & [...string]
1448 "comments"?: list.UniqueItems() & [...string]
1449 ...
1450 }, ...]
1451 ])
1452
1453 // Enforce consistent case for text encoding identifiers.
1454 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/text-encoding-identifier-case.md
1455 "eslint-plugin-unicorn/text-encoding-identifier-case"?: _
1456
1457 // Require `new` when creating an error.
1458 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/rules/throw-new-error.md
1459 "eslint-plugin-unicorn/throw-new-error"?: _
1460
1461 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#import-index
1462 "eslint-plugin-unicorn/import-index"?: _
1463
1464 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#no-array-instanceof
1465 "eslint-plugin-unicorn/no-array-instanceof"?: _
1466
1467 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#no-fn-reference-in-iterator
1468 "eslint-plugin-unicorn/no-fn-reference-in-iterator"?: _
1469
1470 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#no-reduce
1471 "eslint-plugin-unicorn/no-reduce"?: _
1472
1473 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#no-unsafe-regex
1474 "eslint-plugin-unicorn/no-unsafe-regex"?: _
1475
1476 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#prefer-dataset
1477 "eslint-plugin-unicorn/prefer-dataset"?: _
1478
1479 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#prefer-event-key
1480 "eslint-plugin-unicorn/prefer-event-key"?: _
1481
1482 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#prefer-exponentiation-operator
1483 "eslint-plugin-unicorn/prefer-exponentiation-operator"?: _
1484
1485 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#prefer-flat-map
1486 "eslint-plugin-unicorn/prefer-flat-map"?: _
1487
1488 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#prefer-node-append
1489 "eslint-plugin-unicorn/prefer-node-append"?: _
1490
1491 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#prefer-node-remove
1492 "eslint-plugin-unicorn/prefer-node-remove"?: _
1493
1494 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#prefer-object-has-own
1495 "eslint-plugin-unicorn/prefer-object-has-own"?: _
1496
1497 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#prefer-replace-all
1498 "eslint-plugin-unicorn/prefer-replace-all"?: _
1499
1500 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#prefer-starts-ends-with
1501 "eslint-plugin-unicorn/prefer-starts-ends-with"?: _
1502
1503 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#prefer-text-content
1504 "eslint-plugin-unicorn/prefer-text-content"?: _
1505
1506 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#prefer-trim-start-end
1507 "eslint-plugin-unicorn/prefer-trim-start-end"?: _
1508
1509 // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v54.0.0/docs/deprecated-rules.md#regex-shorthand
1510 "eslint-plugin-unicorn/regex-shorthand"?: _
1511
1512 // Enforce linebreaks after opening and before closing array brackets in `<template>`
1513 // https://eslint.vuejs.org/rules/array-bracket-newline.html
1514 "eslint-plugin-vue/array-bracket-newline"?: matchN(1, [
1515 #ruleNumber,
1516 #ruleString,
1517 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1518 ])
1519
1520 // Enforce consistent spacing inside array brackets in `<template>`
1521 // https://eslint.vuejs.org/rules/array-bracket-spacing.html
1522 "eslint-plugin-vue/array-bracket-spacing"?: matchN(1, [
1523 #ruleNumber,
1524 #ruleString,
1525 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1526 ])
1527
1528 // Enforce line breaks after each array element in `<template>`
1529 // https://eslint.vuejs.org/rules/array-element-newline.html
1530 "eslint-plugin-vue/array-element-newline"?: _
1531
1532 // Enforce consistent spacing before and after the arrow in arrow functions in `<template>`
1533 // https://eslint.vuejs.org/rules/arrow-spacing.html
1534 "eslint-plugin-vue/arrow-spacing"?: matchN(1, [
1535 #ruleNumber,
1536 #ruleString,
1537 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1538 "before"?: bool
1539 "after"?: bool
1540 ...
1541 }, ...]
1542 ])
1543
1544 // enforce attribute naming style on custom components in template
1545 // https://eslint.vuejs.org/rules/attribute-hyphenation.html
1546 "eslint-plugin-vue/attribute-hyphenation"?: matchN(1, [
1547 #ruleNumber,
1548 #ruleString,
1549 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1550 ])
1551
1552 // enforce order of attributes
1553 // https://eslint.vuejs.org/rules/attributes-order.html
1554 "eslint-plugin-vue/attributes-order"?: matchN(1, [
1555 #ruleNumber,
1556 #ruleString,
1557 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1558 "order"?: list.UniqueItems() & [
1559 ...matchN(>=1, [
1560 "DEFINITION" |
1561 "LIST_RENDERING" |
1562 "CONDITIONALS" |
1563 "RENDER_MODIFIERS" |
1564 "GLOBAL" |
1565 "UNIQUE" |
1566 "SLOT" |
1567 "TWO_WAY_BINDING" |
1568 "OTHER_DIRECTIVES" |
1569 "OTHER_ATTR" |
1570 "ATTR_STATIC" |
1571 "ATTR_DYNAMIC" |
1572 "ATTR_SHORTHAND_BOOL" |
1573 "EVENTS" |
1574 "CONTENT",
1575 [
1576 ..."DEFINITION" |
1577 "LIST_RENDERING" |
1578 "CONDITIONALS" |
1579 "RENDER_MODIFIERS" |
1580 "GLOBAL" |
1581 "UNIQUE" |
1582 "SLOT" |
1583 "TWO_WAY_BINDING" |
1584 "OTHER_DIRECTIVES" |
1585 "OTHER_ATTR" |
1586 "ATTR_STATIC" |
1587 "ATTR_DYNAMIC" |
1588 "ATTR_SHORTHAND_BOOL" |
1589 "EVENTS" |
1590 "CONTENT"
1591 ],
1592 ])
1593 ]
1594 "alphabetical"?: bool
1595 ...
1596 }, ...]
1597 ])
1598
1599 // disallow use other than available `lang`
1600 // https://eslint.vuejs.org/rules/block-lang.html
1601 "eslint-plugin-vue/block-lang"?: matchN(1, [
1602 #ruleNumber,
1603 #ruleString,
1604 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1605 ])
1606
1607 // enforce order of component top-level elements
1608 // https://eslint.vuejs.org/rules/block-order.html
1609 "eslint-plugin-vue/block-order"?: matchN(1, [
1610 #ruleNumber,
1611 #ruleString,
1612 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1613 "order"?: list.UniqueItems() & [...matchN(>=1, [string, list.UniqueItems() & [...string]])]
1614 ...
1615 }, ...]
1616 ])
1617
1618 // Disallow or enforce spaces inside of blocks after opening block and before
1619 // closing block in `<template>`
1620 // https://eslint.vuejs.org/rules/block-spacing.html
1621 "eslint-plugin-vue/block-spacing"?: matchN(1, [
1622 #ruleNumber,
1623 #ruleString,
1624 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1625 ])
1626
1627 // enforce line breaks after opening and before closing block-level tags
1628 // https://eslint.vuejs.org/rules/block-tag-newline.html
1629 "eslint-plugin-vue/block-tag-newline"?: matchN(1, [
1630 #ruleNumber,
1631 #ruleString,
1632 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1633 "singleline"?: "always" | "never" | "consistent" | "ignore"
1634 "multiline"?: "always" | "never" | "consistent" | "ignore"
1635 "maxEmptyLines"?: >=0
1636 "blocks"?: close({
1637
1638 {
1639 [=~"^(?:\\S+)$"]: close({
1640 "singleline"?: "always" | "never" | "consistent" | "ignore"
1641 "multiline"?: "always" | "never" | "consistent" | "ignore"
1642 "maxEmptyLines"?: >=0
1643 })
1644 }})
1645 ...
1646 }, ...]
1647 ])
1648
1649 // Enforce consistent brace style for blocks in `<template>`
1650 // https://eslint.vuejs.org/rules/brace-style.html
1651 "eslint-plugin-vue/brace-style"?: matchN(1, [
1652 #ruleNumber,
1653 #ruleString,
1654 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1655 ])
1656
1657 // Enforce camelcase naming convention in `<template>`
1658 // https://eslint.vuejs.org/rules/camelcase.html
1659 "eslint-plugin-vue/camelcase"?: matchN(1, [
1660 #ruleNumber,
1661 #ruleString,
1662 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1663 "ignoreDestructuring"?: bool
1664 "ignoreImports"?: bool
1665 "ignoreGlobals"?: bool
1666 "properties"?: "always" | "never"
1667 "allow"?: list.UniqueItems() & [...] & [...string]
1668 ...
1669 }, ...]
1670 ])
1671
1672 // Require or disallow trailing commas in `<template>`
1673 // https://eslint.vuejs.org/rules/comma-dangle.html
1674 "eslint-plugin-vue/comma-dangle"?: _
1675
1676 // Enforce consistent spacing before and after commas in `<template>`
1677 // https://eslint.vuejs.org/rules/comma-spacing.html
1678 "eslint-plugin-vue/comma-spacing"?: matchN(1, [
1679 #ruleNumber,
1680 #ruleString,
1681 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1682 "before"?: bool
1683 "after"?: bool
1684 ...
1685 }, ...]
1686 ])
1687
1688 // Enforce consistent comma style in `<template>`
1689 // https://eslint.vuejs.org/rules/comma-style.html
1690 "eslint-plugin-vue/comma-style"?: matchN(1, [
1691 #ruleNumber,
1692 #ruleString,
1693 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1694 ])
1695
1696 // support comment-directives in `<template>`
1697 // https://eslint.vuejs.org/rules/comment-directive.html
1698 "eslint-plugin-vue/comment-directive"?: matchN(1, [
1699 #ruleNumber,
1700 #ruleString,
1701 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1702 "reportUnusedDisableDirectives"?: bool
1703 ...
1704 }, ...]
1705 ])
1706
1707 // enforce component API style
1708 // https://eslint.vuejs.org/rules/component-api-style.html
1709 "eslint-plugin-vue/component-api-style"?: matchN(1, [
1710 #ruleNumber,
1711 #ruleString,
1712 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1713 ])
1714
1715 // enforce specific casing for component definition name
1716 // https://eslint.vuejs.org/rules/component-definition-name-casing.html
1717 "eslint-plugin-vue/component-definition-name-casing"?: matchN(1, [
1718 #ruleNumber,
1719 #ruleString,
1720 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1721 ])
1722
1723 // enforce specific casing for the component naming style in template
1724 // https://eslint.vuejs.org/rules/component-name-in-template-casing.html
1725 "eslint-plugin-vue/component-name-in-template-casing"?: matchN(1, [
1726 #ruleNumber,
1727 #ruleString,
1728 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1729 ])
1730
1731 // enforce the casing of component name in `components` options
1732 // https://eslint.vuejs.org/rules/component-options-name-casing.html
1733 "eslint-plugin-vue/component-options-name-casing"?: matchN(1, [
1734 #ruleNumber,
1735 #ruleString,
1736 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1737 ])
1738
1739 // enforce order of component top-level elements
1740 // https://eslint.vuejs.org/rules/component-tags-order.html
1741 "eslint-plugin-vue/component-tags-order"?: matchN(1, [
1742 #ruleNumber,
1743 #ruleString,
1744 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1745 "order"?: list.UniqueItems() & [...matchN(>=1, [string, list.UniqueItems() & [...string]])]
1746 ...
1747 }, ...]
1748 ])
1749
1750 // enforce specific casing for custom event name
1751 // https://eslint.vuejs.org/rules/custom-event-name-casing.html
1752 "eslint-plugin-vue/custom-event-name-casing"?: _
1753
1754 // enforce declaration style of `defineEmits`
1755 // https://eslint.vuejs.org/rules/define-emits-declaration.html
1756 "eslint-plugin-vue/define-emits-declaration"?: matchN(1, [
1757 #ruleNumber,
1758 #ruleString,
1759 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1760 ])
1761
1762 // enforce order of `defineEmits` and `defineProps` compiler macros
1763 // https://eslint.vuejs.org/rules/define-macros-order.html
1764 "eslint-plugin-vue/define-macros-order"?: matchN(1, [
1765 #ruleNumber,
1766 #ruleString,
1767 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1768 "order"?: list.UniqueItems() & [
1769 ..."defineEmits" | "defineProps" | "defineOptions" | "defineSlots" | "defineModel"
1770 ]
1771 "defineExposeLast"?: bool
1772 ...
1773 }, ...]
1774 ])
1775
1776 // enforce declaration style of `defineProps`
1777 // https://eslint.vuejs.org/rules/define-props-declaration.html
1778 "eslint-plugin-vue/define-props-declaration"?: matchN(1, [
1779 #ruleNumber,
1780 #ruleString,
1781 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1782 ])
1783
1784 // Enforce consistent newlines before and after dots in `<template>`
1785 // https://eslint.vuejs.org/rules/dot-location.html
1786 "eslint-plugin-vue/dot-location"?: matchN(1, [
1787 #ruleNumber,
1788 #ruleString,
1789 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1790 ])
1791
1792 // Enforce dot notation whenever possible in `<template>`
1793 // https://eslint.vuejs.org/rules/dot-notation.html
1794 "eslint-plugin-vue/dot-notation"?: matchN(1, [
1795 #ruleNumber,
1796 #ruleString,
1797 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1798 "allowKeywords"?: bool
1799 "allowPattern"?: string
1800 ...
1801 }, ...]
1802 ])
1803
1804 // enforce or forbid the use of the `scoped` and `module` attributes in SFC top level style tags
1805 // https://eslint.vuejs.org/rules/enforce-style-attribute.html
1806 "eslint-plugin-vue/enforce-style-attribute"?: matchN(1, [
1807 #ruleNumber,
1808 #ruleString,
1809 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1810 "allow"?: list.MinItems(1) & list.UniqueItems() & [..."plain" | "scoped" | "module"]
1811 ...
1812 }, ...]
1813 ])
1814
1815 // Require the use of `===` and `!==` in `<template>`
1816 // https://eslint.vuejs.org/rules/eqeqeq.html
1817 "eslint-plugin-vue/eqeqeq"?: _
1818
1819 // enforce the location of first attribute
1820 // https://eslint.vuejs.org/rules/first-attribute-linebreak.html
1821 "eslint-plugin-vue/first-attribute-linebreak"?: matchN(1, [
1822 #ruleNumber,
1823 #ruleString,
1824 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1825 "multiline"?: "below" | "beside" | "ignore"
1826 "singleline"?: "below" | "beside" | "ignore"
1827 ...
1828 }, ...]
1829 ])
1830
1831 // Require or disallow spacing between function identifiers and their invocations in `<template>`
1832 // https://eslint.vuejs.org/rules/func-call-spacing.html
1833 "eslint-plugin-vue/func-call-spacing"?: _
1834
1835 // disallow usage of button without an explicit type attribute
1836 // https://eslint.vuejs.org/rules/html-button-has-type.html
1837 "eslint-plugin-vue/html-button-has-type"?: matchN(1, [
1838 #ruleNumber,
1839 #ruleString,
1840 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1841 "button"?: bool
1842 "submit"?: bool
1843 "reset"?: bool
1844 ...
1845 }, ...]
1846 ])
1847
1848 // require or disallow a line break before tag's closing brackets
1849 // https://eslint.vuejs.org/rules/html-closing-bracket-newline.html
1850 "eslint-plugin-vue/html-closing-bracket-newline"?: matchN(1, [
1851 #ruleNumber,
1852 #ruleString,
1853 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1854 "singleline"?: "always" | "never"
1855 "multiline"?: "always" | "never"
1856 "selfClosingTag"?: struct.MinFields(1) & close({
1857 "singleline"?: "always" | "never"
1858 "multiline"?: "always" | "never"
1859 })
1860 ...
1861 }, ...]
1862 ])
1863
1864 // require or disallow a space before tag's closing brackets
1865 // https://eslint.vuejs.org/rules/html-closing-bracket-spacing.html
1866 "eslint-plugin-vue/html-closing-bracket-spacing"?: matchN(1, [
1867 #ruleNumber,
1868 #ruleString,
1869 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1870 "startTag"?: "always" | "never"
1871 "endTag"?: "always" | "never"
1872 "selfClosingTag"?: "always" | "never"
1873 ...
1874 }, ...]
1875 ])
1876
1877 // enforce unified line brake in HTML comments
1878 // https://eslint.vuejs.org/rules/html-comment-content-newline.html
1879 "eslint-plugin-vue/html-comment-content-newline"?: matchN(1, [
1880 #ruleNumber,
1881 #ruleString,
1882 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1883 ])
1884
1885 // enforce unified spacing in HTML comments
1886 // https://eslint.vuejs.org/rules/html-comment-content-spacing.html
1887 "eslint-plugin-vue/html-comment-content-spacing"?: matchN(1, [
1888 #ruleNumber,
1889 #ruleString,
1890 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1891 ])
1892
1893 // enforce consistent indentation in HTML comments
1894 // https://eslint.vuejs.org/rules/html-comment-indent.html
1895 "eslint-plugin-vue/html-comment-indent"?: matchN(1, [
1896 #ruleNumber,
1897 #ruleString,
1898 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1899 ])
1900
1901 // enforce end tag style
1902 // https://eslint.vuejs.org/rules/html-end-tags.html
1903 "eslint-plugin-vue/html-end-tags"?: _
1904
1905 // enforce consistent indentation in `<template>`
1906 // https://eslint.vuejs.org/rules/html-indent.html
1907 "eslint-plugin-vue/html-indent"?: matchN(1, [
1908 #ruleNumber,
1909 #ruleString,
1910 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1911 ])
1912
1913 // enforce quotes style of HTML attributes
1914 // https://eslint.vuejs.org/rules/html-quotes.html
1915 "eslint-plugin-vue/html-quotes"?: matchN(1, [
1916 #ruleNumber,
1917 #ruleString,
1918 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1919 ])
1920
1921 // enforce self-closing style
1922 // https://eslint.vuejs.org/rules/html-self-closing.html
1923 "eslint-plugin-vue/html-self-closing"?: _
1924
1925 // prevent variables used in JSX to be marked as unused
1926 // https://eslint.vuejs.org/rules/jsx-uses-vars.html
1927 "eslint-plugin-vue/jsx-uses-vars"?: _
1928
1929 // Enforce consistent spacing between keys and values in object literal properties in `<template>`
1930 // https://eslint.vuejs.org/rules/key-spacing.html
1931 "eslint-plugin-vue/key-spacing"?: matchN(1, [
1932 #ruleNumber,
1933 #ruleString,
1934 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
1935 ])
1936
1937 // Enforce consistent spacing before and after keywords in `<template>`
1938 // https://eslint.vuejs.org/rules/keyword-spacing.html
1939 "eslint-plugin-vue/keyword-spacing"?: matchN(1, [
1940 #ruleNumber,
1941 #ruleString,
1942 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
1943 "before"?: bool
1944 "after"?: bool
1945 "overrides"?: close({
1946 "abstract"?: close({
1947 "before"?: bool
1948 "after"?: bool
1949 })
1950 "as"?: close({
1951 "before"?: bool
1952 "after"?: bool
1953 })
1954 "async"?: close({
1955 "before"?: bool
1956 "after"?: bool
1957 })
1958 "await"?: close({
1959 "before"?: bool
1960 "after"?: bool
1961 })
1962 "boolean"?: close({
1963 "before"?: bool
1964 "after"?: bool
1965 })
1966 "break"?: close({
1967 "before"?: bool
1968 "after"?: bool
1969 })
1970 "byte"?: close({
1971 "before"?: bool
1972 "after"?: bool
1973 })
1974 "case"?: close({
1975 "before"?: bool
1976 "after"?: bool
1977 })
1978 "catch"?: close({
1979 "before"?: bool
1980 "after"?: bool
1981 })
1982 "char"?: close({
1983 "before"?: bool
1984 "after"?: bool
1985 })
1986 "class"?: close({
1987 "before"?: bool
1988 "after"?: bool
1989 })
1990 "const"?: close({
1991 "before"?: bool
1992 "after"?: bool
1993 })
1994 "continue"?: close({
1995 "before"?: bool
1996 "after"?: bool
1997 })
1998 "debugger"?: close({
1999 "before"?: bool
2000 "after"?: bool
2001 })
2002 "default"?: close({
2003 "before"?: bool
2004 "after"?: bool
2005 })
2006 "delete"?: close({
2007 "before"?: bool
2008 "after"?: bool
2009 })
2010 "do"?: close({
2011 "before"?: bool
2012 "after"?: bool
2013 })
2014 "double"?: close({
2015 "before"?: bool
2016 "after"?: bool
2017 })
2018 "else"?: close({
2019 "before"?: bool
2020 "after"?: bool
2021 })
2022 "enum"?: close({
2023 "before"?: bool
2024 "after"?: bool
2025 })
2026 "export"?: close({
2027 "before"?: bool
2028 "after"?: bool
2029 })
2030 "extends"?: close({
2031 "before"?: bool
2032 "after"?: bool
2033 })
2034 "false"?: close({
2035 "before"?: bool
2036 "after"?: bool
2037 })
2038 "final"?: close({
2039 "before"?: bool
2040 "after"?: bool
2041 })
2042 "finally"?: close({
2043 "before"?: bool
2044 "after"?: bool
2045 })
2046 "float"?: close({
2047 "before"?: bool
2048 "after"?: bool
2049 })
2050 "for"?: close({
2051 "before"?: bool
2052 "after"?: bool
2053 })
2054 "from"?: close({
2055 "before"?: bool
2056 "after"?: bool
2057 })
2058 "function"?: close({
2059 "before"?: bool
2060 "after"?: bool
2061 })
2062 "get"?: close({
2063 "before"?: bool
2064 "after"?: bool
2065 })
2066 "goto"?: close({
2067 "before"?: bool
2068 "after"?: bool
2069 })
2070 "if"?: close({
2071 "before"?: bool
2072 "after"?: bool
2073 })
2074 "implements"?: close({
2075 "before"?: bool
2076 "after"?: bool
2077 })
2078 "import"?: close({
2079 "before"?: bool
2080 "after"?: bool
2081 })
2082 "in"?: close({
2083 "before"?: bool
2084 "after"?: bool
2085 })
2086 "instanceof"?: close({
2087 "before"?: bool
2088 "after"?: bool
2089 })
2090 "int"?: close({
2091 "before"?: bool
2092 "after"?: bool
2093 })
2094 "interface"?: close({
2095 "before"?: bool
2096 "after"?: bool
2097 })
2098 "let"?: close({
2099 "before"?: bool
2100 "after"?: bool
2101 })
2102 "long"?: close({
2103 "before"?: bool
2104 "after"?: bool
2105 })
2106 "native"?: close({
2107 "before"?: bool
2108 "after"?: bool
2109 })
2110 "new"?: close({
2111 "before"?: bool
2112 "after"?: bool
2113 })
2114 "null"?: close({
2115 "before"?: bool
2116 "after"?: bool
2117 })
2118 "of"?: close({
2119 "before"?: bool
2120 "after"?: bool
2121 })
2122 "package"?: close({
2123 "before"?: bool
2124 "after"?: bool
2125 })
2126 "private"?: close({
2127 "before"?: bool
2128 "after"?: bool
2129 })
2130 "protected"?: close({
2131 "before"?: bool
2132 "after"?: bool
2133 })
2134 "public"?: close({
2135 "before"?: bool
2136 "after"?: bool
2137 })
2138 "return"?: close({
2139 "before"?: bool
2140 "after"?: bool
2141 })
2142 "set"?: close({
2143 "before"?: bool
2144 "after"?: bool
2145 })
2146 "short"?: close({
2147 "before"?: bool
2148 "after"?: bool
2149 })
2150 "static"?: close({
2151 "before"?: bool
2152 "after"?: bool
2153 })
2154 "super"?: close({
2155 "before"?: bool
2156 "after"?: bool
2157 })
2158 "switch"?: close({
2159 "before"?: bool
2160 "after"?: bool
2161 })
2162 "synchronized"?: close({
2163 "before"?: bool
2164 "after"?: bool
2165 })
2166 "this"?: close({
2167 "before"?: bool
2168 "after"?: bool
2169 })
2170 "throw"?: close({
2171 "before"?: bool
2172 "after"?: bool
2173 })
2174 "throws"?: close({
2175 "before"?: bool
2176 "after"?: bool
2177 })
2178 "transient"?: close({
2179 "before"?: bool
2180 "after"?: bool
2181 })
2182 "true"?: close({
2183 "before"?: bool
2184 "after"?: bool
2185 })
2186 "try"?: close({
2187 "before"?: bool
2188 "after"?: bool
2189 })
2190 "typeof"?: close({
2191 "before"?: bool
2192 "after"?: bool
2193 })
2194 "var"?: close({
2195 "before"?: bool
2196 "after"?: bool
2197 })
2198 "void"?: close({
2199 "before"?: bool
2200 "after"?: bool
2201 })
2202 "volatile"?: close({
2203 "before"?: bool
2204 "after"?: bool
2205 })
2206 "while"?: close({
2207 "before"?: bool
2208 "after"?: bool
2209 })
2210 "with"?: close({
2211 "before"?: bool
2212 "after"?: bool
2213 })
2214 "yield"?: close({
2215 "before"?: bool
2216 "after"?: bool
2217 })
2218 })
2219 ...
2220 }, ...]
2221 ])
2222
2223 // require component name property to match its file name
2224 // https://eslint.vuejs.org/rules/match-component-file-name.html
2225 "eslint-plugin-vue/match-component-file-name"?: matchN(1, [
2226 #ruleNumber,
2227 #ruleString,
2228 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2229 "extensions"?: list.UniqueItems() & [...string]
2230 "shouldMatchCase"?: bool
2231 ...
2232 }, ...]
2233 ])
2234
2235 // require the registered component name to match the imported component name
2236 // https://eslint.vuejs.org/rules/match-component-import-name.html
2237 "eslint-plugin-vue/match-component-import-name"?: _
2238
2239 // enforce the maximum number of attributes per line
2240 // https://eslint.vuejs.org/rules/max-attributes-per-line.html
2241 "eslint-plugin-vue/max-attributes-per-line"?: matchN(1, [
2242 #ruleNumber,
2243 #ruleString,
2244 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2245 "singleline"?: matchN(>=1, [>=1, close({"max"?: >=1})])
2246 "multiline"?: matchN(>=1, [>=1, close({"max"?: >=1})])
2247 ...
2248 }, ...]
2249 ])
2250
2251 // enforce a maximum line length in `.vue` files
2252 // https://eslint.vuejs.org/rules/max-len.html
2253 "eslint-plugin-vue/max-len"?: matchN(1, [
2254 #ruleNumber,
2255 #ruleString,
2256 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
2257 ])
2258
2259 // enforce maximum number of lines in Vue SFC blocks
2260 // https://eslint.vuejs.org/rules/max-lines-per-block.html
2261 "eslint-plugin-vue/max-lines-per-block"?: matchN(1, [
2262 #ruleNumber,
2263 #ruleString,
2264 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2265 "style"?: int & >=1
2266 "template"?: int & >=1
2267 "script"?: int & >=1
2268 "skipBlankLines"?: bool
2269 ...
2270 }, ...]
2271 ])
2272
2273 // require component names to be always multi-word
2274 // https://eslint.vuejs.org/rules/multi-word-component-names.html
2275 "eslint-plugin-vue/multi-word-component-names"?: matchN(1, [
2276 #ruleNumber,
2277 #ruleString,
2278 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2279 "ignores"?: list.UniqueItems() & [...string]
2280 ...
2281 }, ...]
2282 ])
2283
2284 // require a line break before and after the contents of a multiline element
2285 // https://eslint.vuejs.org/rules/multiline-html-element-content-newline.html
2286 "eslint-plugin-vue/multiline-html-element-content-newline"?: matchN(1, [
2287 #ruleNumber,
2288 #ruleString,
2289 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2290 "ignoreWhenEmpty"?: bool
2291 "ignores"?: list.UniqueItems() & [...string]
2292 "allowEmptyLines"?: bool
2293 ...
2294 }, ...]
2295 ])
2296
2297 // Enforce newlines between operands of ternary expressions in `<template>`
2298 // https://eslint.vuejs.org/rules/multiline-ternary.html
2299 "eslint-plugin-vue/multiline-ternary"?: matchN(1, [
2300 #ruleNumber,
2301 #ruleString,
2302 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
2303 ])
2304
2305 // enforce unified spacing in mustache interpolations
2306 // https://eslint.vuejs.org/rules/mustache-interpolation-spacing.html
2307 "eslint-plugin-vue/mustache-interpolation-spacing"?: matchN(1, [
2308 #ruleNumber,
2309 #ruleString,
2310 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
2311 ])
2312
2313 // enforce new lines between multi-line properties in Vue components
2314 // https://eslint.vuejs.org/rules/new-line-between-multi-line-property.html
2315 "eslint-plugin-vue/new-line-between-multi-line-property"?: matchN(1, [
2316 #ruleNumber,
2317 #ruleString,
2318 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2319 "minLineOfMultilineProperty"?: >=2
2320 ...
2321 }, ...]
2322 ])
2323
2324 // enforce Promise or callback style in `nextTick`
2325 // https://eslint.vuejs.org/rules/next-tick-style.html
2326 "eslint-plugin-vue/next-tick-style"?: matchN(1, [
2327 #ruleNumber,
2328 #ruleString,
2329 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
2330 ])
2331
2332 // disallow using arrow functions to define watcher
2333 // https://eslint.vuejs.org/rules/no-arrow-functions-in-watch.html
2334 "eslint-plugin-vue/no-arrow-functions-in-watch"?: _
2335
2336 // disallow asynchronous actions in computed properties
2337 // https://eslint.vuejs.org/rules/no-async-in-computed-properties.html
2338 "eslint-plugin-vue/no-async-in-computed-properties"?: _
2339
2340 // disallow the use of bare strings in `<template>`
2341 // https://eslint.vuejs.org/rules/no-bare-strings-in-template.html
2342 "eslint-plugin-vue/no-bare-strings-in-template"?: matchN(1, [
2343 #ruleNumber,
2344 #ruleString,
2345 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2346 "allowlist"?: list.UniqueItems() & [...string]
2347 "attributes"?: close({
2348
2349 {[=~"^(?:\\S+|/.*/[a-z]*)$"]: list.UniqueItems() & [...string]}})
2350 "directives"?: list.UniqueItems() & [...=~"^v-"]
2351 ...
2352 }, ...]
2353 ])
2354
2355 // disallow boolean defaults
2356 // https://eslint.vuejs.org/rules/no-boolean-default.html
2357 "eslint-plugin-vue/no-boolean-default"?: matchN(1, [
2358 #ruleNumber,
2359 #ruleString,
2360 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
2361 ])
2362
2363 // disallow element's child contents which would be overwritten by a directive
2364 // like `v-html` or `v-text`
2365 // https://eslint.vuejs.org/rules/no-child-content.html
2366 "eslint-plugin-vue/no-child-content"?: matchN(1, [
2367 #ruleNumber,
2368 #ruleString,
2369 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2370 "additionalDirectives"?: list.UniqueItems() & list.MinItems(1) & [...string]
2371 ...
2372 }, ...]
2373 ])
2374
2375 // disallow accessing computed properties in `data`.
2376 // https://eslint.vuejs.org/rules/no-computed-properties-in-data.html
2377 "eslint-plugin-vue/no-computed-properties-in-data"?: _
2378
2379 // Disallow the use of `console` in `<template>`
2380 // https://eslint.vuejs.org/rules/no-console.html
2381 "eslint-plugin-vue/no-console"?: matchN(1, [
2382 #ruleNumber,
2383 #ruleString,
2384 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2385 "allow"?: list.MinItems(1) & list.UniqueItems() & [...string]
2386 ...
2387 }, ...]
2388 ])
2389
2390 // Disallow constant expressions in conditions in `<template>`
2391 // https://eslint.vuejs.org/rules/no-constant-condition.html
2392 "eslint-plugin-vue/no-constant-condition"?: matchN(1, [
2393 #ruleNumber,
2394 #ruleString,
2395 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2396 "checkLoops"?: bool
2397 ...
2398 }, ...]
2399 ])
2400
2401 // disallow custom modifiers on v-model used on the component
2402 // https://eslint.vuejs.org/rules/no-custom-modifiers-on-v-model.html
2403 "eslint-plugin-vue/no-custom-modifiers-on-v-model"?: _
2404
2405 // disallow using deprecated object declaration on data (in Vue.js 3.0.0+)
2406 // https://eslint.vuejs.org/rules/no-deprecated-data-object-declaration.html
2407 "eslint-plugin-vue/no-deprecated-data-object-declaration"?: _
2408
2409 // disallow using deprecated `destroyed` and `beforeDestroy` lifecycle hooks (in Vue.js 3.0.0+)
2410 // https://eslint.vuejs.org/rules/no-deprecated-destroyed-lifecycle.html
2411 "eslint-plugin-vue/no-deprecated-destroyed-lifecycle"?: _
2412
2413 // disallow using deprecated `$listeners` (in Vue.js 3.0.0+)
2414 // https://eslint.vuejs.org/rules/no-deprecated-dollar-listeners-api.html
2415 "eslint-plugin-vue/no-deprecated-dollar-listeners-api"?: _
2416
2417 // disallow using deprecated `$scopedSlots` (in Vue.js 3.0.0+)
2418 // https://eslint.vuejs.org/rules/no-deprecated-dollar-scopedslots-api.html
2419 "eslint-plugin-vue/no-deprecated-dollar-scopedslots-api"?: _
2420
2421 // disallow using deprecated events api (in Vue.js 3.0.0+)
2422 // https://eslint.vuejs.org/rules/no-deprecated-events-api.html
2423 "eslint-plugin-vue/no-deprecated-events-api"?: _
2424
2425 // disallow using deprecated filters syntax (in Vue.js 3.0.0+)
2426 // https://eslint.vuejs.org/rules/no-deprecated-filter.html
2427 "eslint-plugin-vue/no-deprecated-filter"?: _
2428
2429 // disallow using deprecated the `functional` template (in Vue.js 3.0.0+)
2430 // https://eslint.vuejs.org/rules/no-deprecated-functional-template.html
2431 "eslint-plugin-vue/no-deprecated-functional-template"?: _
2432
2433 // disallow using deprecated the `is` attribute on HTML elements (in Vue.js 3.0.0+)
2434 // https://eslint.vuejs.org/rules/no-deprecated-html-element-is.html
2435 "eslint-plugin-vue/no-deprecated-html-element-is"?: _
2436
2437 // disallow using deprecated `inline-template` attribute (in Vue.js 3.0.0+)
2438 // https://eslint.vuejs.org/rules/no-deprecated-inline-template.html
2439 "eslint-plugin-vue/no-deprecated-inline-template"?: _
2440
2441 // disallow deprecated `model` definition (in Vue.js 3.0.0+)
2442 // https://eslint.vuejs.org/rules/no-deprecated-model-definition.html
2443 "eslint-plugin-vue/no-deprecated-model-definition"?: matchN(1, [
2444 #ruleNumber,
2445 #ruleString,
2446 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2447 "allowVue3Compat"?: bool
2448 ...
2449 }, ...]
2450 ])
2451
2452 // disallow deprecated `this` access in props default function (in Vue.js 3.0.0+)
2453 // https://eslint.vuejs.org/rules/no-deprecated-props-default-this.html
2454 "eslint-plugin-vue/no-deprecated-props-default-this"?: _
2455
2456 // disallow using deprecated `tag` property on `RouterLink` (in Vue.js 3.0.0+)
2457 // https://eslint.vuejs.org/rules/no-deprecated-router-link-tag-prop.html
2458 "eslint-plugin-vue/no-deprecated-router-link-tag-prop"?: matchN(1, [
2459 #ruleNumber,
2460 #ruleString,
2461 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2462 "components"?: list.UniqueItems() & list.MinItems(1) & [...string]
2463 ...
2464 }, ...]
2465 ])
2466
2467 // disallow deprecated `scope` attribute (in Vue.js 2.5.0+)
2468 // https://eslint.vuejs.org/rules/no-deprecated-scope-attribute.html
2469 "eslint-plugin-vue/no-deprecated-scope-attribute"?: _
2470
2471 // disallow deprecated `slot` attribute (in Vue.js 2.6.0+)
2472 // https://eslint.vuejs.org/rules/no-deprecated-slot-attribute.html
2473 "eslint-plugin-vue/no-deprecated-slot-attribute"?: matchN(1, [
2474 #ruleNumber,
2475 #ruleString,
2476 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2477 "ignore"?: list.UniqueItems() & [...string]
2478 ...
2479 }, ...]
2480 ])
2481
2482 // disallow deprecated `slot-scope` attribute (in Vue.js 2.6.0+)
2483 // https://eslint.vuejs.org/rules/no-deprecated-slot-scope-attribute.html
2484 "eslint-plugin-vue/no-deprecated-slot-scope-attribute"?: _
2485
2486 // disallow use of deprecated `.sync` modifier on `v-bind` directive (in Vue.js 3.0.0+)
2487 // https://eslint.vuejs.org/rules/no-deprecated-v-bind-sync.html
2488 "eslint-plugin-vue/no-deprecated-v-bind-sync"?: _
2489
2490 // disallow deprecated `v-is` directive (in Vue.js 3.1.0+)
2491 // https://eslint.vuejs.org/rules/no-deprecated-v-is.html
2492 "eslint-plugin-vue/no-deprecated-v-is"?: _
2493
2494 // disallow using deprecated `.native` modifiers (in Vue.js 3.0.0+)
2495 // https://eslint.vuejs.org/rules/no-deprecated-v-on-native-modifier.html
2496 "eslint-plugin-vue/no-deprecated-v-on-native-modifier"?: _
2497
2498 // disallow using deprecated number (keycode) modifiers (in Vue.js 3.0.0+)
2499 // https://eslint.vuejs.org/rules/no-deprecated-v-on-number-modifiers.html
2500 "eslint-plugin-vue/no-deprecated-v-on-number-modifiers"?: _
2501
2502 // disallow using deprecated `Vue.config.keyCodes` (in Vue.js 3.0.0+)
2503 // https://eslint.vuejs.org/rules/no-deprecated-vue-config-keycodes.html
2504 "eslint-plugin-vue/no-deprecated-vue-config-keycodes"?: _
2505
2506 // disallow duplication of field names
2507 // https://eslint.vuejs.org/rules/no-dupe-keys.html
2508 "eslint-plugin-vue/no-dupe-keys"?: matchN(1, [
2509 #ruleNumber,
2510 #ruleString,
2511 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2512 "groups"?: [...]
2513 ...
2514 }, ...]
2515 ])
2516
2517 // disallow duplicate conditions in `v-if` / `v-else-if` chains
2518 // https://eslint.vuejs.org/rules/no-dupe-v-else-if.html
2519 "eslint-plugin-vue/no-dupe-v-else-if"?: _
2520
2521 // enforce `inheritAttrs` to be set to `false` when using `v-bind="$attrs"`
2522 // https://eslint.vuejs.org/rules/no-duplicate-attr-inheritance.html
2523 "eslint-plugin-vue/no-duplicate-attr-inheritance"?: _
2524
2525 // disallow duplication of attributes
2526 // https://eslint.vuejs.org/rules/no-duplicate-attributes.html
2527 "eslint-plugin-vue/no-duplicate-attributes"?: matchN(1, [
2528 #ruleNumber,
2529 #ruleString,
2530 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2531 "allowCoexistClass"?: bool
2532 "allowCoexistStyle"?: bool
2533 ...
2534 }, ...]
2535 ])
2536
2537 // disallow the `<template>` `<script>` `<style>` block to be empty
2538 // https://eslint.vuejs.org/rules/no-empty-component-block.html
2539 "eslint-plugin-vue/no-empty-component-block"?: _
2540
2541 // Disallow empty destructuring patterns in `<template>`
2542 // https://eslint.vuejs.org/rules/no-empty-pattern.html
2543 "eslint-plugin-vue/no-empty-pattern"?: matchN(1, [
2544 #ruleNumber,
2545 #ruleString,
2546 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2547 "allowObjectPatternsAsParameters"?: bool
2548 ...
2549 }, ...]
2550 ])
2551
2552 // disallow `export` in `<script setup>`
2553 // https://eslint.vuejs.org/rules/no-export-in-script-setup.html
2554 "eslint-plugin-vue/no-export-in-script-setup"?: _
2555
2556 // disallow asynchronously registered `expose`
2557 // https://eslint.vuejs.org/rules/no-expose-after-await.html
2558 "eslint-plugin-vue/no-expose-after-await"?: _
2559
2560 // Disallow unnecessary parentheses in `<template>`
2561 // https://eslint.vuejs.org/rules/no-extra-parens.html
2562 "eslint-plugin-vue/no-extra-parens"?: _
2563
2564 // require valid keys in model option
2565 // https://eslint.vuejs.org/rules/no-invalid-model-keys.html
2566 "eslint-plugin-vue/no-invalid-model-keys"?: _
2567
2568 // disallow irregular whitespace in `.vue` files
2569 // https://eslint.vuejs.org/rules/no-irregular-whitespace.html
2570 "eslint-plugin-vue/no-irregular-whitespace"?: matchN(1, [
2571 #ruleNumber,
2572 #ruleString,
2573 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2574 "skipComments"?: bool
2575 "skipStrings"?: bool
2576 "skipTemplates"?: bool
2577 "skipRegExps"?: bool
2578 "skipHTMLAttributeValues"?: bool
2579 "skipHTMLTextContents"?: bool
2580 ...
2581 }, ...]
2582 ])
2583
2584 // disallow asynchronously registered lifecycle hooks
2585 // https://eslint.vuejs.org/rules/no-lifecycle-after-await.html
2586 "eslint-plugin-vue/no-lifecycle-after-await"?: _
2587
2588 // disallow unnecessary `<template>`
2589 // https://eslint.vuejs.org/rules/no-lone-template.html
2590 "eslint-plugin-vue/no-lone-template"?: matchN(1, [
2591 #ruleNumber,
2592 #ruleString,
2593 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2594 "ignoreAccessible"?: bool
2595 ...
2596 }, ...]
2597 ])
2598
2599 // Disallow literal numbers that lose precision in `<template>`
2600 // https://eslint.vuejs.org/rules/no-loss-of-precision.html
2601 "eslint-plugin-vue/no-loss-of-precision"?: _
2602
2603 // disallow multiple spaces
2604 // https://eslint.vuejs.org/rules/no-multi-spaces.html
2605 "eslint-plugin-vue/no-multi-spaces"?: matchN(1, [
2606 #ruleNumber,
2607 #ruleString,
2608 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2609 "ignoreProperties"?: bool
2610 ...
2611 }, ...]
2612 ])
2613
2614 // disallow to pass multiple objects into array to class
2615 // https://eslint.vuejs.org/rules/no-multiple-objects-in-class.html
2616 "eslint-plugin-vue/no-multiple-objects-in-class"?: _
2617
2618 // disallow to pass multiple arguments to scoped slots
2619 // https://eslint.vuejs.org/rules/no-multiple-slot-args.html
2620 "eslint-plugin-vue/no-multiple-slot-args"?: _
2621
2622 // disallow adding multiple root nodes to the template
2623 // https://eslint.vuejs.org/rules/no-multiple-template-root.html
2624 "eslint-plugin-vue/no-multiple-template-root"?: _
2625
2626 // disallow mutation of component props
2627 // https://eslint.vuejs.org/rules/no-mutating-props.html
2628 "eslint-plugin-vue/no-mutating-props"?: matchN(1, [
2629 #ruleNumber,
2630 #ruleString,
2631 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2632 "shallowOnly"?: bool
2633 ...
2634 }, ...]
2635 ])
2636
2637 // disallow parsing errors in `<template>`
2638 // https://eslint.vuejs.org/rules/no-parsing-error.html
2639 "eslint-plugin-vue/no-parsing-error"?: matchN(1, [
2640 #ruleNumber,
2641 #ruleString,
2642 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2643 "abrupt-closing-of-empty-comment"?: bool
2644 "absence-of-digits-in-numeric-character-reference"?: bool
2645 "cdata-in-html-content"?: bool
2646 "character-reference-outside-unicode-range"?: bool
2647 "control-character-in-input-stream"?: bool
2648 "control-character-reference"?: bool
2649 "eof-before-tag-name"?: bool
2650 "eof-in-cdata"?: bool
2651 "eof-in-comment"?: bool
2652 "eof-in-tag"?: bool
2653 "incorrectly-closed-comment"?: bool
2654 "incorrectly-opened-comment"?: bool
2655 "invalid-first-character-of-tag-name"?: bool
2656 "missing-attribute-value"?: bool
2657 "missing-end-tag-name"?: bool
2658 "missing-semicolon-after-character-reference"?: bool
2659 "missing-whitespace-between-attributes"?: bool
2660 "nested-comment"?: bool
2661 "noncharacter-character-reference"?: bool
2662 "noncharacter-in-input-stream"?: bool
2663 "null-character-reference"?: bool
2664 "surrogate-character-reference"?: bool
2665 "surrogate-in-input-stream"?: bool
2666 "unexpected-character-in-attribute-name"?: bool
2667 "unexpected-character-in-unquoted-attribute-value"?: bool
2668 "unexpected-equals-sign-before-attribute-name"?: bool
2669 "unexpected-null-character"?: bool
2670 "unexpected-question-mark-instead-of-tag-name"?: bool
2671 "unexpected-solidus-in-tag"?: bool
2672 "unknown-named-character-reference"?: bool
2673 "end-tag-with-attributes"?: bool
2674 "duplicate-attribute"?: bool
2675 "end-tag-with-trailing-solidus"?: bool
2676 "non-void-html-element-start-tag-with-trailing-solidus"?: bool
2677 "x-invalid-end-tag"?: bool
2678 "x-invalid-namespace"?: bool
2679 ...
2680 }, ...]
2681 ])
2682
2683 // disallow a potential typo in your component property
2684 // https://eslint.vuejs.org/rules/no-potential-component-option-typo.html
2685 "eslint-plugin-vue/no-potential-component-option-typo"?: matchN(1, [
2686 #ruleNumber,
2687 #ruleString,
2688 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2689 "presets"?: list.UniqueItems() & [...] & [..."all" | "vue" | "vue-router" | "nuxt"]
2690 "custom"?: list.UniqueItems() & [...] & [...string]
2691 "threshold"?: >=1
2692 ...
2693 }, ...]
2694 ])
2695
2696 // disallow use of value wrapped by `ref()` (Composition API) as an operand
2697 // https://eslint.vuejs.org/rules/no-ref-as-operand.html
2698 "eslint-plugin-vue/no-ref-as-operand"?: _
2699
2700 // disallow usages of ref objects that can lead to loss of reactivity
2701 // https://eslint.vuejs.org/rules/no-ref-object-destructure.html
2702 "eslint-plugin-vue/no-ref-object-destructure"?: _
2703
2704 // disallow usages of ref objects that can lead to loss of reactivity
2705 // https://eslint.vuejs.org/rules/no-ref-object-reactivity-loss.html
2706 "eslint-plugin-vue/no-ref-object-reactivity-loss"?: _
2707
2708 // enforce props with default values to be optional
2709 // https://eslint.vuejs.org/rules/no-required-prop-with-default.html
2710 "eslint-plugin-vue/no-required-prop-with-default"?: matchN(1, [
2711 #ruleNumber,
2712 #ruleString,
2713 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2714 "autofix"?: bool
2715 ...
2716 }, ...]
2717 ])
2718
2719 // disallow the use of reserved names in component definitions
2720 // https://eslint.vuejs.org/rules/no-reserved-component-names.html
2721 "eslint-plugin-vue/no-reserved-component-names"?: matchN(1, [
2722 #ruleNumber,
2723 #ruleString,
2724 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2725 "disallowVueBuiltInComponents"?: bool
2726 "disallowVue3BuiltInComponents"?: bool
2727 ...
2728 }, ...]
2729 ])
2730
2731 // disallow overwriting reserved keys
2732 // https://eslint.vuejs.org/rules/no-reserved-keys.html
2733 "eslint-plugin-vue/no-reserved-keys"?: matchN(1, [
2734 #ruleNumber,
2735 #ruleString,
2736 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2737 "reserved"?: [...]
2738 "groups"?: [...]
2739 ...
2740 }, ...]
2741 ])
2742
2743 // disallow reserved names in props
2744 // https://eslint.vuejs.org/rules/no-reserved-props.html
2745 "eslint-plugin-vue/no-reserved-props"?: matchN(1, [
2746 #ruleNumber,
2747 #ruleString,
2748 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2749 "vueVersion"?: 2 | 3
2750 ...
2751 }, ...]
2752 ])
2753
2754 // disallow specific block
2755 // https://eslint.vuejs.org/rules/no-restricted-block.html
2756 "eslint-plugin-vue/no-restricted-block"?: _
2757
2758 // disallow asynchronously called restricted methods
2759 // https://eslint.vuejs.org/rules/no-restricted-call-after-await.html
2760 "eslint-plugin-vue/no-restricted-call-after-await"?: _
2761
2762 // disallow specific classes in Vue components
2763 // https://eslint.vuejs.org/rules/no-restricted-class.html
2764 "eslint-plugin-vue/no-restricted-class"?: _
2765
2766 // disallow specific component names
2767 // https://eslint.vuejs.org/rules/no-restricted-component-names.html
2768 "eslint-plugin-vue/no-restricted-component-names"?: _
2769
2770 // disallow specific component option
2771 // https://eslint.vuejs.org/rules/no-restricted-component-options.html
2772 "eslint-plugin-vue/no-restricted-component-options"?: _
2773
2774 // disallow specific custom event
2775 // https://eslint.vuejs.org/rules/no-restricted-custom-event.html
2776 "eslint-plugin-vue/no-restricted-custom-event"?: _
2777
2778 // disallow specific HTML elements
2779 // https://eslint.vuejs.org/rules/no-restricted-html-elements.html
2780 "eslint-plugin-vue/no-restricted-html-elements"?: _
2781
2782 // disallow specific props
2783 // https://eslint.vuejs.org/rules/no-restricted-props.html
2784 "eslint-plugin-vue/no-restricted-props"?: _
2785
2786 // disallow specific attribute
2787 // https://eslint.vuejs.org/rules/no-restricted-static-attribute.html
2788 "eslint-plugin-vue/no-restricted-static-attribute"?: _
2789
2790 // Disallow specified syntax in `<template>`
2791 // https://eslint.vuejs.org/rules/no-restricted-syntax.html
2792 "eslint-plugin-vue/no-restricted-syntax"?: _
2793
2794 // disallow specific argument in `v-bind`
2795 // https://eslint.vuejs.org/rules/no-restricted-v-bind.html
2796 "eslint-plugin-vue/no-restricted-v-bind"?: _
2797
2798 // disallow specific argument in `v-on`
2799 // https://eslint.vuejs.org/rules/no-restricted-v-on.html
2800 "eslint-plugin-vue/no-restricted-v-on"?: _
2801
2802 // disallow `v-if` directives on root element
2803 // https://eslint.vuejs.org/rules/no-root-v-if.html
2804 "eslint-plugin-vue/no-root-v-if"?: _
2805
2806 // disallow usages that lose the reactivity of `props` passed to `setup`
2807 // https://eslint.vuejs.org/rules/no-setup-props-destructure.html
2808 "eslint-plugin-vue/no-setup-props-destructure"?: _
2809
2810 // disallow usages that lose the reactivity of `props` passed to `setup`
2811 // https://eslint.vuejs.org/rules/no-setup-props-reactivity-loss.html
2812 "eslint-plugin-vue/no-setup-props-reactivity-loss"?: _
2813
2814 // enforce component's data property to be a function
2815 // https://eslint.vuejs.org/rules/no-shared-component-data.html
2816 "eslint-plugin-vue/no-shared-component-data"?: _
2817
2818 // disallow side effects in computed properties
2819 // https://eslint.vuejs.org/rules/no-side-effects-in-computed-properties.html
2820 "eslint-plugin-vue/no-side-effects-in-computed-properties"?: _
2821
2822 // disallow spaces around equal signs in attribute
2823 // https://eslint.vuejs.org/rules/no-spaces-around-equal-signs-in-attribute.html
2824 "eslint-plugin-vue/no-spaces-around-equal-signs-in-attribute"?: _
2825
2826 // Disallow sparse arrays in `<template>`
2827 // https://eslint.vuejs.org/rules/no-sparse-arrays.html
2828 "eslint-plugin-vue/no-sparse-arrays"?: _
2829
2830 // disallow static inline `style` attributes
2831 // https://eslint.vuejs.org/rules/no-static-inline-styles.html
2832 "eslint-plugin-vue/no-static-inline-styles"?: matchN(1, [
2833 #ruleNumber,
2834 #ruleString,
2835 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2836 "allowBinding"?: bool
2837 ...
2838 }, ...]
2839 ])
2840
2841 // disallow `key` attribute on `<template>`
2842 // https://eslint.vuejs.org/rules/no-template-key.html
2843 "eslint-plugin-vue/no-template-key"?: _
2844
2845 // disallow variable declarations from shadowing variables declared in the outer scope
2846 // https://eslint.vuejs.org/rules/no-template-shadow.html
2847 "eslint-plugin-vue/no-template-shadow"?: matchN(1, [
2848 #ruleNumber,
2849 #ruleString,
2850 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2851 "allow"?: list.UniqueItems() & [...string]
2852 ...
2853 }, ...]
2854 ])
2855
2856 // disallow target="_blank" attribute without rel="noopener noreferrer"
2857 // https://eslint.vuejs.org/rules/no-template-target-blank.html
2858 "eslint-plugin-vue/no-template-target-blank"?: matchN(1, [
2859 #ruleNumber,
2860 #ruleString,
2861 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2862 "allowReferrer"?: bool
2863 "enforceDynamicLinks"?: "always" | "never"
2864 ...
2865 }, ...]
2866 ])
2867
2868 // disallow mustaches in `<textarea>`
2869 // https://eslint.vuejs.org/rules/no-textarea-mustache.html
2870 "eslint-plugin-vue/no-textarea-mustache"?: _
2871
2872 // disallow `this` usage in a `beforeRouteEnter` method
2873 // https://eslint.vuejs.org/rules/no-this-in-before-route-enter.html
2874 "eslint-plugin-vue/no-this-in-before-route-enter"?: _
2875
2876 // disallow use of undefined components in `<template>`
2877 // https://eslint.vuejs.org/rules/no-undef-components.html
2878 "eslint-plugin-vue/no-undef-components"?: matchN(1, [
2879 #ruleNumber,
2880 #ruleString,
2881 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2882 "ignorePatterns"?: [...]
2883 ...
2884 }, ...]
2885 ])
2886
2887 // disallow undefined properties
2888 // https://eslint.vuejs.org/rules/no-undef-properties.html
2889 "eslint-plugin-vue/no-undef-properties"?: matchN(1, [
2890 #ruleNumber,
2891 #ruleString,
2892 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2893 "ignores"?: list.UniqueItems() & [...string]
2894 ...
2895 }, ...]
2896 ])
2897
2898 // disallow unsupported Vue.js syntax on the specified version
2899 // https://eslint.vuejs.org/rules/no-unsupported-features.html
2900 "eslint-plugin-vue/no-unsupported-features"?: matchN(1, [
2901 #ruleNumber,
2902 #ruleString,
2903 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2904 "version"?: string
2905 "ignores"?: list.UniqueItems() & [
2906 ..."slot-scope-attribute" |
2907 "dynamic-directive-arguments" |
2908 "v-slot" |
2909 "script-setup" |
2910 "style-css-vars-injection" |
2911 "v-model-argument" |
2912 "v-model-custom-modifiers" |
2913 "v-is" |
2914 "is-attribute-with-vue-prefix" |
2915 "v-memo" |
2916 "v-bind-prop-modifier-shorthand" |
2917 "v-bind-attr-modifier" |
2918 "define-options" |
2919 "define-slots" |
2920 "define-model" |
2921 "v-bind-same-name-shorthand"
2922 ]
2923 ...
2924 }, ...]
2925 ])
2926
2927 // disallow registering components that are not used inside templates
2928 // https://eslint.vuejs.org/rules/no-unused-components.html
2929 "eslint-plugin-vue/no-unused-components"?: matchN(1, [
2930 #ruleNumber,
2931 #ruleString,
2932 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2933 "ignoreWhenBindingPresent"?: bool
2934 ...
2935 }, ...]
2936 ])
2937
2938 // disallow unused emit declarations
2939 // https://eslint.vuejs.org/rules/no-unused-emit-declarations.html
2940 "eslint-plugin-vue/no-unused-emit-declarations"?: _
2941
2942 // disallow unused properties
2943 // https://eslint.vuejs.org/rules/no-unused-properties.html
2944 "eslint-plugin-vue/no-unused-properties"?: matchN(1, [
2945 #ruleNumber,
2946 #ruleString,
2947 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2948 "groups"?: list.UniqueItems() & [..."props" | "data" | "asyncData" | "computed" | "methods" | "setup"]
2949 "deepData"?: bool
2950 "ignorePublicMembers"?: bool
2951 "unreferencedOptions"?: list.UniqueItems() & [..."unknownMemberAsUnreferenced" | "returnAsUnreferenced"]
2952 ...
2953 }, ...]
2954 ])
2955
2956 // disallow unused refs
2957 // https://eslint.vuejs.org/rules/no-unused-refs.html
2958 "eslint-plugin-vue/no-unused-refs"?: _
2959
2960 // disallow unused variable definitions of v-for directives or scope attributes
2961 // https://eslint.vuejs.org/rules/no-unused-vars.html
2962 "eslint-plugin-vue/no-unused-vars"?: matchN(1, [
2963 #ruleNumber,
2964 #ruleString,
2965 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2966 "ignorePattern"?: string
2967 ...
2968 }, ...]
2969 ])
2970
2971 // disallow use computed property like method
2972 // https://eslint.vuejs.org/rules/no-use-computed-property-like-method.html
2973 "eslint-plugin-vue/no-use-computed-property-like-method"?: _
2974
2975 // disallow using `v-else-if`/`v-else` on the same element as `v-for`
2976 // https://eslint.vuejs.org/rules/no-use-v-else-with-v-for.html
2977 "eslint-plugin-vue/no-use-v-else-with-v-for"?: _
2978
2979 // disallow using `v-if` on the same element as `v-for`
2980 // https://eslint.vuejs.org/rules/no-use-v-if-with-v-for.html
2981 "eslint-plugin-vue/no-use-v-if-with-v-for"?: matchN(1, [
2982 #ruleNumber,
2983 #ruleString,
2984 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
2985 "allowUsingIterationVar"?: bool
2986 ...
2987 }, ...]
2988 ])
2989
2990 // Disallow unnecessary concatenation of literals or template literals in `<template>`
2991 // https://eslint.vuejs.org/rules/no-useless-concat.html
2992 "eslint-plugin-vue/no-useless-concat"?: _
2993
2994 // disallow unnecessary mustache interpolations
2995 // https://eslint.vuejs.org/rules/no-useless-mustaches.html
2996 "eslint-plugin-vue/no-useless-mustaches"?: matchN(1, [
2997 #ruleNumber,
2998 #ruleString,
2999 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3000 "ignoreIncludesComment"?: bool
3001 "ignoreStringEscape"?: bool
3002 ...
3003 }, ...]
3004 ])
3005
3006 // disallow useless attribute on `<template>`
3007 // https://eslint.vuejs.org/rules/no-useless-template-attributes.html
3008 "eslint-plugin-vue/no-useless-template-attributes"?: _
3009
3010 // disallow unnecessary `v-bind` directives
3011 // https://eslint.vuejs.org/rules/no-useless-v-bind.html
3012 "eslint-plugin-vue/no-useless-v-bind"?: matchN(1, [
3013 #ruleNumber,
3014 #ruleString,
3015 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3016 "ignoreIncludesComment"?: bool
3017 "ignoreStringEscape"?: bool
3018 ...
3019 }, ...]
3020 ])
3021
3022 // disallow key of `<template v-for>` placed on child elements
3023 // https://eslint.vuejs.org/rules/no-v-for-template-key-on-child.html
3024 "eslint-plugin-vue/no-v-for-template-key-on-child"?: _
3025
3026 // disallow `key` attribute on `<template v-for>`
3027 // https://eslint.vuejs.org/rules/no-v-for-template-key.html
3028 "eslint-plugin-vue/no-v-for-template-key"?: _
3029
3030 // disallow use of v-html to prevent XSS attack
3031 // https://eslint.vuejs.org/rules/no-v-html.html
3032 "eslint-plugin-vue/no-v-html"?: _
3033
3034 // disallow adding an argument to `v-model` used in custom component
3035 // https://eslint.vuejs.org/rules/no-v-model-argument.html
3036 "eslint-plugin-vue/no-v-model-argument"?: _
3037
3038 // disallow v-text / v-html on component
3039 // https://eslint.vuejs.org/rules/no-v-text-v-html-on-component.html
3040 "eslint-plugin-vue/no-v-text-v-html-on-component"?: matchN(1, [
3041 #ruleNumber,
3042 #ruleString,
3043 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3044 "allow"?: list.UniqueItems() & [...string]
3045 ...
3046 }, ...]
3047 ])
3048
3049 // disallow use of v-text
3050 // https://eslint.vuejs.org/rules/no-v-text.html
3051 "eslint-plugin-vue/no-v-text"?: _
3052
3053 // disallow asynchronously registered `watch`
3054 // https://eslint.vuejs.org/rules/no-watch-after-await.html
3055 "eslint-plugin-vue/no-watch-after-await"?: _
3056
3057 // Enforce consistent line breaks after opening and before closing braces in `<template>`
3058 // https://eslint.vuejs.org/rules/object-curly-newline.html
3059 "eslint-plugin-vue/object-curly-newline"?: matchN(1, [
3060 #ruleNumber,
3061 #ruleString,
3062 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3063 ])
3064
3065 // Enforce consistent spacing inside braces in `<template>`
3066 // https://eslint.vuejs.org/rules/object-curly-spacing.html
3067 "eslint-plugin-vue/object-curly-spacing"?: matchN(1, [
3068 #ruleNumber,
3069 #ruleString,
3070 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3071 ])
3072
3073 // Enforce placing object properties on separate lines in `<template>`
3074 // https://eslint.vuejs.org/rules/object-property-newline.html
3075 "eslint-plugin-vue/object-property-newline"?: matchN(1, [
3076 #ruleNumber,
3077 #ruleString,
3078 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3079 "allowAllPropertiesOnSameLine"?: bool
3080 "allowMultiplePropertiesPerLine"?: bool
3081 ...
3082 }, ...]
3083 ])
3084
3085 // Require or disallow method and property shorthand syntax for object literals in `<template>`
3086 // https://eslint.vuejs.org/rules/object-shorthand.html
3087 "eslint-plugin-vue/object-shorthand"?: _
3088
3089 // enforce that each component should be in its own file
3090 // https://eslint.vuejs.org/rules/one-component-per-file.html
3091 "eslint-plugin-vue/one-component-per-file"?: _
3092
3093 // Enforce consistent linebreak style for operators in `<template>`
3094 // https://eslint.vuejs.org/rules/operator-linebreak.html
3095 "eslint-plugin-vue/operator-linebreak"?: matchN(1, [
3096 #ruleNumber,
3097 #ruleString,
3098 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3099 ])
3100
3101 // enforce order of properties in components
3102 // https://eslint.vuejs.org/rules/order-in-components.html
3103 "eslint-plugin-vue/order-in-components"?: matchN(1, [
3104 #ruleNumber,
3105 #ruleString,
3106 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3107 "order"?: [...]
3108 ...
3109 }, ...]
3110 ])
3111
3112 // require or disallow padding lines between blocks
3113 // https://eslint.vuejs.org/rules/padding-line-between-blocks.html
3114 "eslint-plugin-vue/padding-line-between-blocks"?: matchN(1, [
3115 #ruleNumber,
3116 #ruleString,
3117 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3118 ])
3119
3120 // require or disallow newlines between sibling tags in template
3121 // https://eslint.vuejs.org/rules/padding-line-between-tags.html
3122 "eslint-plugin-vue/padding-line-between-tags"?: matchN(1, [
3123 #ruleNumber,
3124 #ruleString,
3125 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3126 ])
3127
3128 // require or disallow padding lines in component definition
3129 // https://eslint.vuejs.org/rules/padding-lines-in-component-definition.html
3130 "eslint-plugin-vue/padding-lines-in-component-definition"?: matchN(1, [
3131 #ruleNumber,
3132 #ruleString,
3133 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3134 ])
3135
3136 // enforce use of `defineOptions` instead of default export.
3137 // https://eslint.vuejs.org/rules/prefer-define-options.html
3138 "eslint-plugin-vue/prefer-define-options"?: _
3139
3140 // enforce import from 'vue' instead of import from '@vue/*'
3141 // https://eslint.vuejs.org/rules/prefer-import-from-vue.html
3142 "eslint-plugin-vue/prefer-import-from-vue"?: _
3143
3144 // enforce `Boolean` comes first in component prop types
3145 // https://eslint.vuejs.org/rules/prefer-prop-type-boolean-first.html
3146 "eslint-plugin-vue/prefer-prop-type-boolean-first"?: _
3147
3148 // require static class names in template to be in a separate `class` attribute
3149 // https://eslint.vuejs.org/rules/prefer-separate-static-class.html
3150 "eslint-plugin-vue/prefer-separate-static-class"?: _
3151
3152 // Require template literals instead of string concatenation in `<template>`
3153 // https://eslint.vuejs.org/rules/prefer-template.html
3154 "eslint-plugin-vue/prefer-template"?: _
3155
3156 // require shorthand form attribute when `v-bind` value is `true`
3157 // https://eslint.vuejs.org/rules/prefer-true-attribute-shorthand.html
3158 "eslint-plugin-vue/prefer-true-attribute-shorthand"?: matchN(1, [
3159 #ruleNumber,
3160 #ruleString,
3161 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3162 ])
3163
3164 // enforce specific casing for the Prop name in Vue components
3165 // https://eslint.vuejs.org/rules/prop-name-casing.html
3166 "eslint-plugin-vue/prop-name-casing"?: matchN(1, [
3167 #ruleNumber,
3168 #ruleString,
3169 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3170 ])
3171
3172 // Require quotes around object literal property names in `<template>`
3173 // https://eslint.vuejs.org/rules/quote-props.html
3174 "eslint-plugin-vue/quote-props"?: _
3175
3176 // require `v-bind:is` of `<component>` elements
3177 // https://eslint.vuejs.org/rules/require-component-is.html
3178 "eslint-plugin-vue/require-component-is"?: _
3179
3180 // require default value for props
3181 // https://eslint.vuejs.org/rules/require-default-prop.html
3182 "eslint-plugin-vue/require-default-prop"?: _
3183
3184 // require the component to be directly exported
3185 // https://eslint.vuejs.org/rules/require-direct-export.html
3186 "eslint-plugin-vue/require-direct-export"?: matchN(1, [
3187 #ruleNumber,
3188 #ruleString,
3189 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3190 "disallowFunctionalComponentFunction"?: bool
3191 ...
3192 }, ...]
3193 ])
3194
3195 // require type definitions in emits
3196 // https://eslint.vuejs.org/rules/require-emit-validator.html
3197 "eslint-plugin-vue/require-emit-validator"?: _
3198
3199 // require `emits` option with name triggered by `$emit()`
3200 // https://eslint.vuejs.org/rules/require-explicit-emits.html
3201 "eslint-plugin-vue/require-explicit-emits"?: matchN(1, [
3202 #ruleNumber,
3203 #ruleString,
3204 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3205 "allowProps"?: bool
3206 ...
3207 }, ...]
3208 ])
3209
3210 // require slots to be explicitly defined
3211 // https://eslint.vuejs.org/rules/require-explicit-slots.html
3212 "eslint-plugin-vue/require-explicit-slots"?: _
3213
3214 // require declare public properties using `expose`
3215 // https://eslint.vuejs.org/rules/require-expose.html
3216 "eslint-plugin-vue/require-expose"?: _
3217
3218 // require a certain macro variable name
3219 // https://eslint.vuejs.org/rules/require-macro-variable-name.html
3220 "eslint-plugin-vue/require-macro-variable-name"?: matchN(1, [
3221 #ruleNumber,
3222 #ruleString,
3223 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3224 "defineProps"?: string
3225 "defineEmits"?: string
3226 "defineSlots"?: string
3227 "useSlots"?: string
3228 "useAttrs"?: string
3229 ...
3230 }, ...]
3231 ])
3232
3233 // require a name property in Vue components
3234 // https://eslint.vuejs.org/rules/require-name-property.html
3235 "eslint-plugin-vue/require-name-property"?: _
3236
3237 // require props to have a comment
3238 // https://eslint.vuejs.org/rules/require-prop-comment.html
3239 "eslint-plugin-vue/require-prop-comment"?: matchN(1, [
3240 #ruleNumber,
3241 #ruleString,
3242 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3243 "type"?: "JSDoc" | "line" | "block" | "any"
3244 ...
3245 }, ...]
3246 ])
3247
3248 // require prop type to be a constructor
3249 // https://eslint.vuejs.org/rules/require-prop-type-constructor.html
3250 "eslint-plugin-vue/require-prop-type-constructor"?: _
3251
3252 // require type definitions in props
3253 // https://eslint.vuejs.org/rules/require-prop-types.html
3254 "eslint-plugin-vue/require-prop-types"?: _
3255
3256 // enforce render function to always return value
3257 // https://eslint.vuejs.org/rules/require-render-return.html
3258 "eslint-plugin-vue/require-render-return"?: _
3259
3260 // enforce properties of `$slots` to be used as a function
3261 // https://eslint.vuejs.org/rules/require-slots-as-functions.html
3262 "eslint-plugin-vue/require-slots-as-functions"?: _
3263
3264 // require control the display of the content inside `<transition>`
3265 // https://eslint.vuejs.org/rules/require-toggle-inside-transition.html
3266 "eslint-plugin-vue/require-toggle-inside-transition"?: _
3267
3268 // enforce adding type declarations to object props
3269 // https://eslint.vuejs.org/rules/require-typed-object-prop.html
3270 "eslint-plugin-vue/require-typed-object-prop"?: _
3271
3272 // require `ref` and `shallowRef` functions to be strongly typed
3273 // https://eslint.vuejs.org/rules/require-typed-ref.html
3274 "eslint-plugin-vue/require-typed-ref"?: _
3275
3276 // require `v-bind:key` with `v-for` directives
3277 // https://eslint.vuejs.org/rules/require-v-for-key.html
3278 "eslint-plugin-vue/require-v-for-key"?: _
3279
3280 // enforce props default values to be valid
3281 // https://eslint.vuejs.org/rules/require-valid-default-prop.html
3282 "eslint-plugin-vue/require-valid-default-prop"?: _
3283
3284 // enforce that a return statement is present in computed property
3285 // https://eslint.vuejs.org/rules/return-in-computed-property.html
3286 "eslint-plugin-vue/return-in-computed-property"?: matchN(1, [
3287 #ruleNumber,
3288 #ruleString,
3289 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3290 "treatUndefinedAsUnspecified"?: bool
3291 ...
3292 }, ...]
3293 ])
3294
3295 // enforce that a return statement is present in emits validator
3296 // https://eslint.vuejs.org/rules/return-in-emits-validator.html
3297 "eslint-plugin-vue/return-in-emits-validator"?: _
3298
3299 // enforce consistent indentation in `<script>`
3300 // https://eslint.vuejs.org/rules/script-indent.html
3301 "eslint-plugin-vue/script-indent"?: matchN(1, [
3302 #ruleNumber,
3303 #ruleString,
3304 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3305 ])
3306
3307 // prevent `<script setup>` variables used in `<template>` to be marked as unused
3308 // https://eslint.vuejs.org/rules/script-setup-uses-vars.html
3309 "eslint-plugin-vue/script-setup-uses-vars"?: _
3310
3311 // require a line break before and after the contents of a singleline element
3312 // https://eslint.vuejs.org/rules/singleline-html-element-content-newline.html
3313 "eslint-plugin-vue/singleline-html-element-content-newline"?: matchN(1, [
3314 #ruleNumber,
3315 #ruleString,
3316 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3317 "ignoreWhenNoAttributes"?: bool
3318 "ignoreWhenEmpty"?: bool
3319 "ignores"?: list.UniqueItems() & [...string]
3320 "externalIgnores"?: list.UniqueItems() & [...string]
3321 ...
3322 }, ...]
3323 ])
3324
3325 // enforce sort-keys in a manner that is compatible with order-in-components
3326 // https://eslint.vuejs.org/rules/sort-keys.html
3327 "eslint-plugin-vue/sort-keys"?: matchN(1, [
3328 #ruleNumber,
3329 #ruleString,
3330 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3331 ])
3332
3333 // Enforce consistent spacing inside parentheses in `<template>`
3334 // https://eslint.vuejs.org/rules/space-in-parens.html
3335 "eslint-plugin-vue/space-in-parens"?: matchN(1, [
3336 #ruleNumber,
3337 #ruleString,
3338 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3339 ])
3340
3341 // Require spacing around infix operators in `<template>`
3342 // https://eslint.vuejs.org/rules/space-infix-ops.html
3343 "eslint-plugin-vue/space-infix-ops"?: matchN(1, [
3344 #ruleNumber,
3345 #ruleString,
3346 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3347 "int32Hint"?: bool
3348 ...
3349 }, ...]
3350 ])
3351
3352 // Enforce consistent spacing before or after unary operators in `<template>`
3353 // https://eslint.vuejs.org/rules/space-unary-ops.html
3354 "eslint-plugin-vue/space-unary-ops"?: matchN(1, [
3355 #ruleNumber,
3356 #ruleString,
3357 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3358 "words"?: bool
3359 "nonwords"?: bool
3360 "overrides"?: [string]: bool
3361 ...
3362 }, ...]
3363 ])
3364
3365 // enforce static class names order
3366 // https://eslint.vuejs.org/rules/static-class-names-order.html
3367 "eslint-plugin-vue/static-class-names-order"?: _
3368
3369 // Require or disallow spacing around embedded expressions of template strings in `<template>`
3370 // https://eslint.vuejs.org/rules/template-curly-spacing.html
3371 "eslint-plugin-vue/template-curly-spacing"?: matchN(1, [
3372 #ruleNumber,
3373 #ruleString,
3374 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3375 ])
3376
3377 // disallow usage of `this` in template
3378 // https://eslint.vuejs.org/rules/this-in-template.html
3379 "eslint-plugin-vue/this-in-template"?: matchN(1, [
3380 #ruleNumber,
3381 #ruleString,
3382 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3383 ])
3384
3385 // enforce usage of `exact` modifier on `v-on`
3386 // https://eslint.vuejs.org/rules/use-v-on-exact.html
3387 "eslint-plugin-vue/use-v-on-exact"?: _
3388
3389 // enforce `v-bind` directive style
3390 // https://eslint.vuejs.org/rules/v-bind-style.html
3391 "eslint-plugin-vue/v-bind-style"?: matchN(1, [
3392 #ruleNumber,
3393 #ruleString,
3394 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3395 ])
3396
3397 // enforce `v-for` directive's delimiter style
3398 // https://eslint.vuejs.org/rules/v-for-delimiter-style.html
3399 "eslint-plugin-vue/v-for-delimiter-style"?: matchN(1, [
3400 #ruleNumber,
3401 #ruleString,
3402 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3403 ])
3404
3405 // require key attribute for conditionally rendered repeated components
3406 // https://eslint.vuejs.org/rules/v-if-else-key.html
3407 "eslint-plugin-vue/v-if-else-key"?: _
3408
3409 // enforce v-on event naming style on custom components in template
3410 // https://eslint.vuejs.org/rules/v-on-event-hyphenation.html
3411 "eslint-plugin-vue/v-on-event-hyphenation"?: matchN(1, [
3412 #ruleNumber,
3413 #ruleString,
3414 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3415 ])
3416
3417 // enforce or forbid parentheses after method calls without arguments in `v-on` directives
3418 // https://eslint.vuejs.org/rules/v-on-function-call.html
3419 "eslint-plugin-vue/v-on-function-call"?: matchN(1, [
3420 #ruleNumber,
3421 #ruleString,
3422 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3423 ])
3424
3425 // enforce writing style for handlers in `v-on` directives
3426 // https://eslint.vuejs.org/rules/v-on-handler-style.html
3427 "eslint-plugin-vue/v-on-handler-style"?: matchN(1, [
3428 #ruleNumber,
3429 #ruleString,
3430 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3431 ])
3432
3433 // enforce `v-on` directive style
3434 // https://eslint.vuejs.org/rules/v-on-style.html
3435 "eslint-plugin-vue/v-on-style"?: matchN(1, [
3436 #ruleNumber,
3437 #ruleString,
3438 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3439 ])
3440
3441 // enforce `v-slot` directive style
3442 // https://eslint.vuejs.org/rules/v-slot-style.html
3443 "eslint-plugin-vue/v-slot-style"?: matchN(1, [
3444 #ruleNumber,
3445 #ruleString,
3446 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3447 ])
3448
3449 // require valid attribute names
3450 // https://eslint.vuejs.org/rules/valid-attribute-name.html
3451 "eslint-plugin-vue/valid-attribute-name"?: _
3452
3453 // enforce valid `defineEmits` compiler macro
3454 // https://eslint.vuejs.org/rules/valid-define-emits.html
3455 "eslint-plugin-vue/valid-define-emits"?: _
3456
3457 // enforce valid `defineOptions` compiler macro
3458 // https://eslint.vuejs.org/rules/valid-define-options.html
3459 "eslint-plugin-vue/valid-define-options"?: _
3460
3461 // enforce valid `defineProps` compiler macro
3462 // https://eslint.vuejs.org/rules/valid-define-props.html
3463 "eslint-plugin-vue/valid-define-props"?: _
3464
3465 // require valid keys in model option
3466 // https://eslint.vuejs.org/rules/valid-model-definition.html
3467 "eslint-plugin-vue/valid-model-definition"?: _
3468
3469 // enforce valid `nextTick` function calls
3470 // https://eslint.vuejs.org/rules/valid-next-tick.html
3471 "eslint-plugin-vue/valid-next-tick"?: _
3472
3473 // enforce valid template root
3474 // https://eslint.vuejs.org/rules/valid-template-root.html
3475 "eslint-plugin-vue/valid-template-root"?: _
3476
3477 // enforce valid `.sync` modifier on `v-bind` directives
3478 // https://eslint.vuejs.org/rules/valid-v-bind-sync.html
3479 "eslint-plugin-vue/valid-v-bind-sync"?: _
3480
3481 // enforce valid `v-bind` directives
3482 // https://eslint.vuejs.org/rules/valid-v-bind.html
3483 "eslint-plugin-vue/valid-v-bind"?: _
3484
3485 // enforce valid `v-cloak` directives
3486 // https://eslint.vuejs.org/rules/valid-v-cloak.html
3487 "eslint-plugin-vue/valid-v-cloak"?: _
3488
3489 // enforce valid `v-else-if` directives
3490 // https://eslint.vuejs.org/rules/valid-v-else-if.html
3491 "eslint-plugin-vue/valid-v-else-if"?: _
3492
3493 // enforce valid `v-else` directives
3494 // https://eslint.vuejs.org/rules/valid-v-else.html
3495 "eslint-plugin-vue/valid-v-else"?: _
3496
3497 // enforce valid `v-for` directives
3498 // https://eslint.vuejs.org/rules/valid-v-for.html
3499 "eslint-plugin-vue/valid-v-for"?: _
3500
3501 // enforce valid `v-html` directives
3502 // https://eslint.vuejs.org/rules/valid-v-html.html
3503 "eslint-plugin-vue/valid-v-html"?: _
3504
3505 // enforce valid `v-if` directives
3506 // https://eslint.vuejs.org/rules/valid-v-if.html
3507 "eslint-plugin-vue/valid-v-if"?: _
3508
3509 // enforce valid `v-is` directives
3510 // https://eslint.vuejs.org/rules/valid-v-is.html
3511 "eslint-plugin-vue/valid-v-is"?: _
3512
3513 // enforce valid `v-memo` directives
3514 // https://eslint.vuejs.org/rules/valid-v-memo.html
3515 "eslint-plugin-vue/valid-v-memo"?: _
3516
3517 // enforce valid `v-model` directives
3518 // https://eslint.vuejs.org/rules/valid-v-model.html
3519 "eslint-plugin-vue/valid-v-model"?: _
3520
3521 // enforce valid `v-on` directives
3522 // https://eslint.vuejs.org/rules/valid-v-on.html
3523 "eslint-plugin-vue/valid-v-on"?: matchN(1, [
3524 #ruleNumber,
3525 #ruleString,
3526 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3527 "modifiers"?: [...]
3528 ...
3529 }, ...]
3530 ])
3531
3532 // enforce valid `v-once` directives
3533 // https://eslint.vuejs.org/rules/valid-v-once.html
3534 "eslint-plugin-vue/valid-v-once"?: _
3535
3536 // enforce valid `v-pre` directives
3537 // https://eslint.vuejs.org/rules/valid-v-pre.html
3538 "eslint-plugin-vue/valid-v-pre"?: _
3539
3540 // enforce valid `v-show` directives
3541 // https://eslint.vuejs.org/rules/valid-v-show.html
3542 "eslint-plugin-vue/valid-v-show"?: _
3543
3544 // enforce valid `v-slot` directives
3545 // https://eslint.vuejs.org/rules/valid-v-slot.html
3546 "eslint-plugin-vue/valid-v-slot"?: matchN(1, [
3547 #ruleNumber,
3548 #ruleString,
3549 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3550 "allowModifiers"?: bool
3551 ...
3552 }, ...]
3553 ])
3554
3555 // enforce valid `v-text` directives
3556 // https://eslint.vuejs.org/rules/valid-v-text.html
3557 "eslint-plugin-vue/valid-v-text"?: _
3558
3559 // Require that function overload signatures be consecutive
3560 // https://typescript-eslint.io/rules/adjacent-overload-signatures
3561 "@typescript-eslint/adjacent-overload-signatures"?: _
3562
3563 // Require consistently using either `T[]` or `Array<T>` for arrays
3564 // https://typescript-eslint.io/rules/array-type
3565 "@typescript-eslint/array-type"?: matchN(1, [
3566 #ruleNumber,
3567 #ruleString,
3568 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3569 // The array type expected for mutable cases.
3570 "default"?: _
3571
3572 // The array type expected for readonly cases. If omitted, the value for `default` will be used.
3573 "readonly"?: _
3574 ...
3575 }, ...]
3576 ])
3577
3578 // Disallow awaiting a value that is not a Thenable
3579 // https://typescript-eslint.io/rules/await-thenable
3580 "@typescript-eslint/await-thenable"?: _
3581
3582 // Disallow `@ts-<directive>` comments or require descriptions after directives
3583 // https://typescript-eslint.io/rules/ban-ts-comment
3584 "@typescript-eslint/ban-ts-comment"?: matchN(1, [
3585 #ruleNumber,
3586 #ruleString,
3587 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3588 "ts-expect-error"?: _
3589 "ts-ignore"?: _
3590 "ts-nocheck"?: _
3591 "ts-check"?: _
3592 "minimumDescriptionLength"?: number
3593 ...
3594 }, ...]
3595 ])
3596
3597 // Disallow `// tslint:<rule-flag>` comments
3598 // https://typescript-eslint.io/rules/ban-tslint-comment
3599 "@typescript-eslint/ban-tslint-comment"?: _
3600
3601 // Disallow certain types
3602 // https://typescript-eslint.io/rules/ban-types
3603 "@typescript-eslint/ban-types"?: matchN(1, [
3604 #ruleNumber,
3605 #ruleString,
3606 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3607 "types"?: [string]: _
3608 "extendDefaults"?: bool
3609 ...
3610 }, ...]
3611 ])
3612
3613 // Disallow or enforce spaces inside of blocks after opening block and before closing block
3614 // https://typescript-eslint.io/rules/block-spacing
3615 "@typescript-eslint/block-spacing"?: matchN(1, [
3616 #ruleNumber,
3617 #ruleString,
3618 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3619 ])
3620
3621 // Enforce consistent brace style for blocks
3622 // https://typescript-eslint.io/rules/brace-style
3623 "@typescript-eslint/brace-style"?: matchN(1, [
3624 #ruleNumber,
3625 #ruleString,
3626 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3627 ])
3628
3629 // Enforce that literals on classes are exposed in a consistent style
3630 // https://typescript-eslint.io/rules/class-literal-property-style
3631 "@typescript-eslint/class-literal-property-style"?: matchN(1, [
3632 #ruleNumber,
3633 #ruleString,
3634 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3635 ])
3636
3637 // Enforce that class methods utilize `this`
3638 // https://typescript-eslint.io/rules/class-methods-use-this
3639 "@typescript-eslint/class-methods-use-this"?: matchN(1, [
3640 #ruleNumber,
3641 #ruleString,
3642 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3643 // Allows specified method names to be ignored with this rule
3644 "exceptMethods"?: [...string]
3645
3646 // Enforces that functions used as instance field initializers utilize `this`
3647 "enforceForClassFields"?: bool
3648
3649 // Ignore members marked with the `override` modifier
3650 "ignoreOverrideMethods"?: bool
3651
3652 // Ignore classes that specifically implement some interface
3653 "ignoreClassesThatImplementAnInterface"?: matchN(1, [bool, "public-fields"])
3654 ...
3655 }, ...]
3656 ])
3657
3658 // Require or disallow trailing commas
3659 // https://typescript-eslint.io/rules/comma-dangle
3660 "@typescript-eslint/comma-dangle"?: _
3661
3662 // Enforce consistent spacing before and after commas
3663 // https://typescript-eslint.io/rules/comma-spacing
3664 "@typescript-eslint/comma-spacing"?: matchN(1, [
3665 #ruleNumber,
3666 #ruleString,
3667 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3668 "before"?: bool
3669 "after"?: bool
3670 ...
3671 }, ...]
3672 ])
3673
3674 // Enforce specifying generic type arguments on type annotation or constructor
3675 // name of a constructor call
3676 // https://typescript-eslint.io/rules/consistent-generic-constructors
3677 "@typescript-eslint/consistent-generic-constructors"?: matchN(1, [
3678 #ruleNumber,
3679 #ruleString,
3680 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3681 ])
3682
3683 // Require or disallow the `Record` type
3684 // https://typescript-eslint.io/rules/consistent-indexed-object-style
3685 "@typescript-eslint/consistent-indexed-object-style"?: matchN(1, [
3686 #ruleNumber,
3687 #ruleString,
3688 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), "record" | "index-signature", ...]
3689 ])
3690
3691 // Require `return` statements to either always or never specify values
3692 // https://typescript-eslint.io/rules/consistent-return
3693 "@typescript-eslint/consistent-return"?: matchN(1, [
3694 #ruleNumber,
3695 #ruleString,
3696 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3697 "treatUndefinedAsUnspecified"?: bool
3698 ...
3699 }, ...]
3700 ])
3701
3702 // Enforce consistent usage of type assertions
3703 // https://typescript-eslint.io/rules/consistent-type-assertions
3704 "@typescript-eslint/consistent-type-assertions"?: matchN(1, [
3705 #ruleNumber,
3706 #ruleString,
3707 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3708 ])
3709
3710 // Enforce type definitions to consistently use either `interface` or `type`
3711 // https://typescript-eslint.io/rules/consistent-type-definitions
3712 "@typescript-eslint/consistent-type-definitions"?: matchN(1, [
3713 #ruleNumber,
3714 #ruleString,
3715 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), "interface" | "type", ...]
3716 ])
3717
3718 // Enforce consistent usage of type exports
3719 // https://typescript-eslint.io/rules/consistent-type-exports
3720 "@typescript-eslint/consistent-type-exports"?: matchN(1, [
3721 #ruleNumber,
3722 #ruleString,
3723 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3724 "fixMixedExportsWithInlineTypeSpecifier"?: bool
3725 ...
3726 }, ...]
3727 ])
3728
3729 // Enforce consistent usage of type imports
3730 // https://typescript-eslint.io/rules/consistent-type-imports
3731 "@typescript-eslint/consistent-type-imports"?: matchN(1, [
3732 #ruleNumber,
3733 #ruleString,
3734 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3735 "disallowTypeAnnotations"?: bool
3736 "fixStyle"?: "separate-type-imports" | "inline-type-imports"
3737 "prefer"?: "type-imports" | "no-type-imports"
3738 ...
3739 }, ...]
3740 ])
3741
3742 // Enforce default parameters to be last
3743 // https://typescript-eslint.io/rules/default-param-last
3744 "@typescript-eslint/default-param-last"?: _
3745
3746 // Enforce dot notation whenever possible
3747 // https://typescript-eslint.io/rules/dot-notation
3748 "@typescript-eslint/dot-notation"?: matchN(1, [
3749 #ruleNumber,
3750 #ruleString,
3751 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3752 "allowKeywords"?: bool
3753 "allowPattern"?: string
3754 "allowPrivateClassPropertyAccess"?: bool
3755 "allowProtectedClassPropertyAccess"?: bool
3756 "allowIndexSignaturePropertyAccess"?: bool
3757 ...
3758 }, ...]
3759 ])
3760
3761 // Require explicit return types on functions and class methods
3762 // https://typescript-eslint.io/rules/explicit-function-return-type
3763 "@typescript-eslint/explicit-function-return-type"?: matchN(1, [
3764 #ruleNumber,
3765 #ruleString,
3766 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3767 // Whether to allow arrow functions that start with the `void` keyword.
3768 "allowConciseArrowFunctionExpressionsStartingWithVoid"?: bool
3769
3770 // Whether to ignore function expressions (functions which are not part of a declaration).
3771 "allowExpressions"?: bool
3772
3773 // Whether to ignore functions immediately returning another function expression.
3774 "allowHigherOrderFunctions"?: bool
3775
3776 // Whether to ignore type annotations on the variable of function expressions.
3777 "allowTypedFunctionExpressions"?: bool
3778
3779 // Whether to ignore arrow functions immediately returning a `as const` value.
3780 "allowDirectConstAssertionInArrowFunctions"?: bool
3781
3782 // Whether to ignore functions that don't have generic type parameters.
3783 "allowFunctionsWithoutTypeParameters"?: bool
3784
3785 // An array of function/method names that will not have their arguments or return values checked.
3786 "allowedNames"?: [...string]
3787
3788 // Whether to ignore immediately invoked function expressions (IIFEs).
3789 "allowIIFEs"?: bool
3790 ...
3791 }, ...]
3792 ])
3793
3794 // Require explicit accessibility modifiers on class properties and methods
3795 // https://typescript-eslint.io/rules/explicit-member-accessibility
3796 "@typescript-eslint/explicit-member-accessibility"?: matchN(1, [
3797 #ruleNumber,
3798 #ruleString,
3799 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3800 "accessibility"?: _
3801 "overrides"?: close({
3802 "accessors"?: _
3803 "constructors"?: _
3804 "methods"?: _
3805 "properties"?: _
3806 "parameterProperties"?: _
3807 })
3808 "ignoredMethodNames"?: [...string]
3809 ...
3810 }, ...]
3811 ])
3812
3813 // Require explicit return and argument types on exported functions' and
3814 // classes' public class methods
3815 // https://typescript-eslint.io/rules/explicit-module-boundary-types
3816 "@typescript-eslint/explicit-module-boundary-types"?: matchN(1, [
3817 #ruleNumber,
3818 #ruleString,
3819 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3820 // Whether to ignore arguments that are explicitly typed as `any`.
3821 "allowArgumentsExplicitlyTypedAsAny"?: bool
3822
3823 // Whether to ignore return type annotations on body-less arrow functions that
3824 // return an `as const` type assertion.
3825 // You must still type the parameters of the function.
3826 "allowDirectConstAssertionInArrowFunctions"?: bool
3827
3828 // An array of function/method names that will not have their arguments or return values checked.
3829 "allowedNames"?: [...string]
3830
3831 // Whether to ignore return type annotations on functions immediately returning
3832 // another function expression.
3833 // You must still type the parameters of the function.
3834 "allowHigherOrderFunctions"?: bool
3835
3836 // Whether to ignore type annotations on the variable of a function expression.
3837 "allowTypedFunctionExpressions"?: bool
3838 ...
3839 }, ...]
3840 ])
3841
3842 // Require or disallow spacing between function identifiers and their invocations
3843 // https://typescript-eslint.io/rules/func-call-spacing
3844 "@typescript-eslint/func-call-spacing"?: _
3845
3846 // Enforce consistent indentation
3847 // https://typescript-eslint.io/rules/indent
3848 "@typescript-eslint/indent"?: matchN(1, [
3849 #ruleNumber,
3850 #ruleString,
3851 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3852 ])
3853
3854 // Require or disallow initialization in variable declarations
3855 // https://typescript-eslint.io/rules/init-declarations
3856 "@typescript-eslint/init-declarations"?: _
3857
3858 // Enforce consistent spacing between property names and type annotations in types and interfaces
3859 // https://typescript-eslint.io/rules/key-spacing
3860 "@typescript-eslint/key-spacing"?: matchN(1, [
3861 #ruleNumber,
3862 #ruleString,
3863 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
3864 ])
3865
3866 // Enforce consistent spacing before and after keywords
3867 // https://typescript-eslint.io/rules/keyword-spacing
3868 "@typescript-eslint/keyword-spacing"?: matchN(1, [
3869 #ruleNumber,
3870 #ruleString,
3871 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
3872 "before"?: bool
3873 "after"?: bool
3874 "overrides"?: close({
3875 "abstract"?: close({
3876 "before"?: bool
3877 "after"?: bool
3878 })
3879 "as"?: close({
3880 "before"?: bool
3881 "after"?: bool
3882 })
3883 "async"?: close({
3884 "before"?: bool
3885 "after"?: bool
3886 })
3887 "await"?: close({
3888 "before"?: bool
3889 "after"?: bool
3890 })
3891 "boolean"?: close({
3892 "before"?: bool
3893 "after"?: bool
3894 })
3895 "break"?: close({
3896 "before"?: bool
3897 "after"?: bool
3898 })
3899 "byte"?: close({
3900 "before"?: bool
3901 "after"?: bool
3902 })
3903 "case"?: close({
3904 "before"?: bool
3905 "after"?: bool
3906 })
3907 "catch"?: close({
3908 "before"?: bool
3909 "after"?: bool
3910 })
3911 "char"?: close({
3912 "before"?: bool
3913 "after"?: bool
3914 })
3915 "class"?: close({
3916 "before"?: bool
3917 "after"?: bool
3918 })
3919 "const"?: close({
3920 "before"?: bool
3921 "after"?: bool
3922 })
3923 "continue"?: close({
3924 "before"?: bool
3925 "after"?: bool
3926 })
3927 "debugger"?: close({
3928 "before"?: bool
3929 "after"?: bool
3930 })
3931 "default"?: close({
3932 "before"?: bool
3933 "after"?: bool
3934 })
3935 "delete"?: close({
3936 "before"?: bool
3937 "after"?: bool
3938 })
3939 "do"?: close({
3940 "before"?: bool
3941 "after"?: bool
3942 })
3943 "double"?: close({
3944 "before"?: bool
3945 "after"?: bool
3946 })
3947 "else"?: close({
3948 "before"?: bool
3949 "after"?: bool
3950 })
3951 "enum"?: close({
3952 "before"?: bool
3953 "after"?: bool
3954 })
3955 "export"?: close({
3956 "before"?: bool
3957 "after"?: bool
3958 })
3959 "extends"?: close({
3960 "before"?: bool
3961 "after"?: bool
3962 })
3963 "false"?: close({
3964 "before"?: bool
3965 "after"?: bool
3966 })
3967 "final"?: close({
3968 "before"?: bool
3969 "after"?: bool
3970 })
3971 "finally"?: close({
3972 "before"?: bool
3973 "after"?: bool
3974 })
3975 "float"?: close({
3976 "before"?: bool
3977 "after"?: bool
3978 })
3979 "for"?: close({
3980 "before"?: bool
3981 "after"?: bool
3982 })
3983 "from"?: close({
3984 "before"?: bool
3985 "after"?: bool
3986 })
3987 "function"?: close({
3988 "before"?: bool
3989 "after"?: bool
3990 })
3991 "get"?: close({
3992 "before"?: bool
3993 "after"?: bool
3994 })
3995 "goto"?: close({
3996 "before"?: bool
3997 "after"?: bool
3998 })
3999 "if"?: close({
4000 "before"?: bool
4001 "after"?: bool
4002 })
4003 "implements"?: close({
4004 "before"?: bool
4005 "after"?: bool
4006 })
4007 "import"?: close({
4008 "before"?: bool
4009 "after"?: bool
4010 })
4011 "in"?: close({
4012 "before"?: bool
4013 "after"?: bool
4014 })
4015 "instanceof"?: close({
4016 "before"?: bool
4017 "after"?: bool
4018 })
4019 "int"?: close({
4020 "before"?: bool
4021 "after"?: bool
4022 })
4023 "interface"?: close({
4024 "before"?: bool
4025 "after"?: bool
4026 })
4027 "let"?: close({
4028 "before"?: bool
4029 "after"?: bool
4030 })
4031 "long"?: close({
4032 "before"?: bool
4033 "after"?: bool
4034 })
4035 "native"?: close({
4036 "before"?: bool
4037 "after"?: bool
4038 })
4039 "new"?: close({
4040 "before"?: bool
4041 "after"?: bool
4042 })
4043 "null"?: close({
4044 "before"?: bool
4045 "after"?: bool
4046 })
4047 "of"?: close({
4048 "before"?: bool
4049 "after"?: bool
4050 })
4051 "package"?: close({
4052 "before"?: bool
4053 "after"?: bool
4054 })
4055 "private"?: close({
4056 "before"?: bool
4057 "after"?: bool
4058 })
4059 "protected"?: close({
4060 "before"?: bool
4061 "after"?: bool
4062 })
4063 "public"?: close({
4064 "before"?: bool
4065 "after"?: bool
4066 })
4067 "return"?: close({
4068 "before"?: bool
4069 "after"?: bool
4070 })
4071 "set"?: close({
4072 "before"?: bool
4073 "after"?: bool
4074 })
4075 "short"?: close({
4076 "before"?: bool
4077 "after"?: bool
4078 })
4079 "static"?: close({
4080 "before"?: bool
4081 "after"?: bool
4082 })
4083 "super"?: close({
4084 "before"?: bool
4085 "after"?: bool
4086 })
4087 "switch"?: close({
4088 "before"?: bool
4089 "after"?: bool
4090 })
4091 "synchronized"?: close({
4092 "before"?: bool
4093 "after"?: bool
4094 })
4095 "this"?: close({
4096 "before"?: bool
4097 "after"?: bool
4098 })
4099 "throw"?: close({
4100 "before"?: bool
4101 "after"?: bool
4102 })
4103 "throws"?: close({
4104 "before"?: bool
4105 "after"?: bool
4106 })
4107 "transient"?: close({
4108 "before"?: bool
4109 "after"?: bool
4110 })
4111 "true"?: close({
4112 "before"?: bool
4113 "after"?: bool
4114 })
4115 "try"?: close({
4116 "before"?: bool
4117 "after"?: bool
4118 })
4119 "typeof"?: close({
4120 "before"?: bool
4121 "after"?: bool
4122 })
4123 "var"?: close({
4124 "before"?: bool
4125 "after"?: bool
4126 })
4127 "void"?: close({
4128 "before"?: bool
4129 "after"?: bool
4130 })
4131 "volatile"?: close({
4132 "before"?: bool
4133 "after"?: bool
4134 })
4135 "while"?: close({
4136 "before"?: bool
4137 "after"?: bool
4138 })
4139 "with"?: close({
4140 "before"?: bool
4141 "after"?: bool
4142 })
4143 "yield"?: close({
4144 "before"?: bool
4145 "after"?: bool
4146 })
4147 "type"?: close({
4148 "before"?: bool
4149 "after"?: bool
4150 })
4151 })
4152 ...
4153 }, ...]
4154 ])
4155
4156 // Require empty lines around comments
4157 // https://typescript-eslint.io/rules/lines-around-comment
4158 "@typescript-eslint/lines-around-comment"?: matchN(1, [
4159 #ruleNumber,
4160 #ruleString,
4161 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4162 "beforeBlockComment"?: bool
4163 "afterBlockComment"?: bool
4164 "beforeLineComment"?: bool
4165 "afterLineComment"?: bool
4166 "allowBlockStart"?: bool
4167 "allowBlockEnd"?: bool
4168 "allowClassStart"?: bool
4169 "allowClassEnd"?: bool
4170 "allowObjectStart"?: bool
4171 "allowObjectEnd"?: bool
4172 "allowArrayStart"?: bool
4173 "allowArrayEnd"?: bool
4174 "allowInterfaceStart"?: bool
4175 "allowInterfaceEnd"?: bool
4176 "allowTypeStart"?: bool
4177 "allowTypeEnd"?: bool
4178 "allowEnumStart"?: bool
4179 "allowEnumEnd"?: bool
4180 "allowModuleStart"?: bool
4181 "allowModuleEnd"?: bool
4182 "ignorePattern"?: string
4183 "applyDefaultIgnorePatterns"?: bool
4184 ...
4185 }, ...]
4186 ])
4187
4188 // Require or disallow an empty line between class members
4189 // https://typescript-eslint.io/rules/lines-between-class-members
4190 "@typescript-eslint/lines-between-class-members"?: matchN(1, [
4191 #ruleNumber,
4192 #ruleString,
4193 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
4194 ])
4195
4196 // Enforce a maximum number of parameters in function definitions
4197 // https://typescript-eslint.io/rules/max-params
4198 "@typescript-eslint/max-params"?: matchN(1, [
4199 #ruleNumber,
4200 #ruleString,
4201 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4202 "maximum"?: int & >=0
4203 "max"?: int & >=0
4204 "countVoidThis"?: bool
4205 ...
4206 }, ...]
4207 ])
4208
4209 // Require a specific member delimiter style for interfaces and type literals
4210 // https://typescript-eslint.io/rules/member-delimiter-style
4211 "@typescript-eslint/member-delimiter-style"?: matchN(1, [
4212 #ruleNumber,
4213 #ruleString,
4214 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4215 "multiline"?: close({
4216 "delimiter"?: _
4217 "requireLast"?: bool
4218 })
4219 "singleline"?: close({
4220 "delimiter"?: _
4221 "requireLast"?: bool
4222 })
4223 "overrides"?: close({
4224 "interface"?: _
4225 "typeLiteral"?: _
4226 })
4227 "multilineDetection"?: "brackets" | "last-member"
4228 ...
4229 }, ...]
4230 ])
4231
4232 // Require a consistent member declaration order
4233 // https://typescript-eslint.io/rules/member-ordering
4234 "@typescript-eslint/member-ordering"?: matchN(1, [
4235 #ruleNumber,
4236 #ruleString,
4237 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4238 "default"?: _
4239 "classes"?: _
4240 "classExpressions"?: _
4241 "interfaces"?: _
4242 "typeLiterals"?: _
4243 ...
4244 }, ...]
4245 ])
4246
4247 // Enforce using a particular method signature syntax
4248 // https://typescript-eslint.io/rules/method-signature-style
4249 "@typescript-eslint/method-signature-style"?: matchN(1, [
4250 #ruleNumber,
4251 #ruleString,
4252 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
4253 ])
4254
4255 // Enforce naming conventions for everything across a codebase
4256 // https://typescript-eslint.io/rules/naming-convention
4257 "@typescript-eslint/naming-convention"?: _
4258
4259 // Disallow generic `Array` constructors
4260 // https://typescript-eslint.io/rules/no-array-constructor
4261 "@typescript-eslint/no-array-constructor"?: _
4262
4263 // Disallow using the `delete` operator on array values
4264 // https://typescript-eslint.io/rules/no-array-delete
4265 "@typescript-eslint/no-array-delete"?: _
4266
4267 // Require `.toString()` to only be called on objects which provide useful
4268 // information when stringified
4269 // https://typescript-eslint.io/rules/no-base-to-string
4270 "@typescript-eslint/no-base-to-string"?: matchN(1, [
4271 #ruleNumber,
4272 #ruleString,
4273 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4274 "ignoredTypeNames"?: [...string]
4275 ...
4276 }, ...]
4277 ])
4278
4279 // Disallow non-null assertion in locations that may be confusing
4280 // https://typescript-eslint.io/rules/no-confusing-non-null-assertion
4281 "@typescript-eslint/no-confusing-non-null-assertion"?: _
4282
4283 // Require expressions of type void to appear in statement position
4284 // https://typescript-eslint.io/rules/no-confusing-void-expression
4285 "@typescript-eslint/no-confusing-void-expression"?: matchN(1, [
4286 #ruleNumber,
4287 #ruleString,
4288 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4289 "ignoreArrowShorthand"?: bool
4290 "ignoreVoidOperator"?: bool
4291 ...
4292 }, ...]
4293 ])
4294
4295 // Disallow duplicate class members
4296 // https://typescript-eslint.io/rules/no-dupe-class-members
4297 "@typescript-eslint/no-dupe-class-members"?: _
4298
4299 // Disallow duplicate enum member values
4300 // https://typescript-eslint.io/rules/no-duplicate-enum-values
4301 "@typescript-eslint/no-duplicate-enum-values"?: _
4302
4303 // Disallow duplicate constituents of union or intersection types
4304 // https://typescript-eslint.io/rules/no-duplicate-type-constituents
4305 "@typescript-eslint/no-duplicate-type-constituents"?: matchN(1, [
4306 #ruleNumber,
4307 #ruleString,
4308 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4309 "ignoreIntersections"?: bool
4310 "ignoreUnions"?: bool
4311 ...
4312 }, ...]
4313 ])
4314
4315 // Disallow using the `delete` operator on computed key expressions
4316 // https://typescript-eslint.io/rules/no-dynamic-delete
4317 "@typescript-eslint/no-dynamic-delete"?: _
4318
4319 // Disallow empty functions
4320 // https://typescript-eslint.io/rules/no-empty-function
4321 "@typescript-eslint/no-empty-function"?: matchN(1, [
4322 #ruleNumber,
4323 #ruleString,
4324 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4325 "allow"?: list.UniqueItems() & [
4326 ..."functions" |
4327 "arrowFunctions" |
4328 "generatorFunctions" |
4329 "methods" |
4330 "generatorMethods" |
4331 "getters" |
4332 "setters" |
4333 "constructors" |
4334 "private-constructors" |
4335 "protected-constructors" |
4336 "asyncFunctions" |
4337 "asyncMethods" |
4338 "decoratedFunctions" |
4339 "overrideMethods"
4340 ]
4341 ...
4342 }, ...]
4343 ])
4344
4345 // Disallow the declaration of empty interfaces
4346 // https://typescript-eslint.io/rules/no-empty-interface
4347 "@typescript-eslint/no-empty-interface"?: matchN(1, [
4348 #ruleNumber,
4349 #ruleString,
4350 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4351 "allowSingleExtends"?: bool
4352 ...
4353 }, ...]
4354 ])
4355
4356 // Disallow the `any` type
4357 // https://typescript-eslint.io/rules/no-explicit-any
4358 "@typescript-eslint/no-explicit-any"?: matchN(1, [
4359 #ruleNumber,
4360 #ruleString,
4361 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4362 // Whether to enable auto-fixing in which the `any` type is converted to the `unknown` type.
4363 "fixToUnknown"?: bool
4364
4365 // Whether to ignore rest parameter arrays.
4366 "ignoreRestArgs"?: bool
4367 ...
4368 }, ...]
4369 ])
4370
4371 // Disallow extra non-null assertions
4372 // https://typescript-eslint.io/rules/no-extra-non-null-assertion
4373 "@typescript-eslint/no-extra-non-null-assertion"?: _
4374
4375 // Disallow unnecessary parentheses
4376 // https://typescript-eslint.io/rules/no-extra-parens
4377 "@typescript-eslint/no-extra-parens"?: _
4378
4379 // Disallow unnecessary semicolons
4380 // https://typescript-eslint.io/rules/no-extra-semi
4381 "@typescript-eslint/no-extra-semi"?: _
4382
4383 // Disallow classes used as namespaces
4384 // https://typescript-eslint.io/rules/no-extraneous-class
4385 "@typescript-eslint/no-extraneous-class"?: matchN(1, [
4386 #ruleNumber,
4387 #ruleString,
4388 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4389 // Whether to allow extraneous classes that contain only a constructor.
4390 "allowConstructorOnly"?: bool
4391
4392 // Whether to allow extraneous classes that have no body (i.e. are empty).
4393 "allowEmpty"?: bool
4394
4395 // Whether to allow extraneous classes that only contain static members.
4396 "allowStaticOnly"?: bool
4397
4398 // Whether to allow extraneous classes that include a decorator.
4399 "allowWithDecorator"?: bool
4400 ...
4401 }, ...]
4402 ])
4403
4404 // Require Promise-like statements to be handled appropriately
4405 // https://typescript-eslint.io/rules/no-floating-promises
4406 "@typescript-eslint/no-floating-promises"?: matchN(1, [
4407 #ruleNumber,
4408 #ruleString,
4409 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4410 // Whether to ignore `void` expressions.
4411 "ignoreVoid"?: bool
4412
4413 // Whether to ignore async IIFEs (Immediately Invoked Function Expressions).
4414 "ignoreIIFE"?: bool
4415 "allowForKnownSafePromises"?: [...matchN(1, [
4416 string,
4417 close({
4418 "from"!: "file"
4419 "name"!: matchN(1, [string, list.MinItems(1) & list.UniqueItems() & [...string]])
4420 "path"?: string
4421 }), close({
4422 "from"!: "lib"
4423 "name"!: matchN(1, [string, list.MinItems(1) & list.UniqueItems() & [...string]])
4424 }), close({
4425 "from"!: "package"
4426 "name"!: matchN(1, [string, list.MinItems(1) & list.UniqueItems() & [...string]])
4427 "package"!: string
4428 })
4429 ])]
4430 ...
4431 }, ...]
4432 ])
4433
4434 // Disallow iterating over an array with a for-in loop
4435 // https://typescript-eslint.io/rules/no-for-in-array
4436 "@typescript-eslint/no-for-in-array"?: _
4437
4438 // Disallow the use of `eval()`-like methods
4439 // https://typescript-eslint.io/rules/no-implied-eval
4440 "@typescript-eslint/no-implied-eval"?: _
4441
4442 // Enforce the use of top-level import type qualifier when an import only has
4443 // specifiers with inline type qualifiers
4444 // https://typescript-eslint.io/rules/no-import-type-side-effects
4445 "@typescript-eslint/no-import-type-side-effects"?: _
4446
4447 // Disallow explicit type declarations for variables or parameters initialized
4448 // to a number, string, or boolean
4449 // https://typescript-eslint.io/rules/no-inferrable-types
4450 "@typescript-eslint/no-inferrable-types"?: matchN(1, [
4451 #ruleNumber,
4452 #ruleString,
4453 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4454 "ignoreParameters"?: bool
4455 "ignoreProperties"?: bool
4456 ...
4457 }, ...]
4458 ])
4459
4460 // Disallow `this` keywords outside of classes or class-like objects
4461 // https://typescript-eslint.io/rules/no-invalid-this
4462 "@typescript-eslint/no-invalid-this"?: matchN(1, [
4463 #ruleNumber,
4464 #ruleString,
4465 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4466 "capIsConstructor"?: bool
4467 ...
4468 }, ...]
4469 ])
4470
4471 // Disallow `void` type outside of generic or return types
4472 // https://typescript-eslint.io/rules/no-invalid-void-type
4473 "@typescript-eslint/no-invalid-void-type"?: matchN(1, [
4474 #ruleNumber,
4475 #ruleString,
4476 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4477 "allowInGenericTypeArguments"?: matchN(1, [bool, list.MinItems(1) & [...string]])
4478 "allowAsThisParameter"?: bool
4479 ...
4480 }, ...]
4481 ])
4482
4483 // Disallow function declarations that contain unsafe references inside loop statements
4484 // https://typescript-eslint.io/rules/no-loop-func
4485 "@typescript-eslint/no-loop-func"?: _
4486
4487 // Disallow literal numbers that lose precision
4488 // https://typescript-eslint.io/rules/no-loss-of-precision
4489 "@typescript-eslint/no-loss-of-precision"?: _
4490
4491 // Disallow magic numbers
4492 // https://typescript-eslint.io/rules/no-magic-numbers
4493 "@typescript-eslint/no-magic-numbers"?: matchN(1, [
4494 #ruleNumber,
4495 #ruleString,
4496 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4497 "detectObjects"?: bool
4498 "enforceConst"?: bool
4499 "ignore"?: list.UniqueItems() & [...matchN(>=1, [number, =~"^[+-]?(?:0|[1-9][0-9]*)n$"])]
4500 "ignoreArrayIndexes"?: bool
4501 "ignoreDefaultValues"?: bool
4502 "ignoreClassFieldInitialValues"?: bool
4503 "ignoreNumericLiteralTypes"?: bool
4504 "ignoreEnums"?: bool
4505 "ignoreReadonlyClassProperties"?: bool
4506 "ignoreTypeIndexes"?: bool
4507 ...
4508 }, ...]
4509 ])
4510
4511 // Disallow the `void` operator except when used to discard a value
4512 // https://typescript-eslint.io/rules/no-meaningless-void-operator
4513 "@typescript-eslint/no-meaningless-void-operator"?: matchN(1, [
4514 #ruleNumber,
4515 #ruleString,
4516 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4517 "checkNever"?: bool
4518 ...
4519 }, ...]
4520 ])
4521
4522 // Enforce valid definition of `new` and `constructor`
4523 // https://typescript-eslint.io/rules/no-misused-new
4524 "@typescript-eslint/no-misused-new"?: _
4525
4526 // Disallow Promises in places not designed to handle them
4527 // https://typescript-eslint.io/rules/no-misused-promises
4528 "@typescript-eslint/no-misused-promises"?: matchN(1, [
4529 #ruleNumber,
4530 #ruleString,
4531 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4532 "checksConditionals"?: bool
4533 "checksVoidReturn"?: matchN(1, [
4534 bool,
4535 close({
4536 "arguments"?: bool
4537 "attributes"?: bool
4538 "properties"?: bool
4539 "returns"?: bool
4540 "variables"?: bool
4541 })
4542 ])
4543 "checksSpreads"?: bool
4544 ...
4545 }, ...]
4546 ])
4547
4548 // Disallow enums from having both number and string members
4549 // https://typescript-eslint.io/rules/no-mixed-enums
4550 "@typescript-eslint/no-mixed-enums"?: _
4551
4552 // Disallow TypeScript namespaces
4553 // https://typescript-eslint.io/rules/no-namespace
4554 "@typescript-eslint/no-namespace"?: matchN(1, [
4555 #ruleNumber,
4556 #ruleString,
4557 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4558 // Whether to allow `declare` with custom TypeScript namespaces.
4559 "allowDeclarations"?: bool
4560
4561 // Whether to allow `declare` with custom TypeScript namespaces inside definition files.
4562 "allowDefinitionFiles"?: bool
4563 ...
4564 }, ...]
4565 ])
4566
4567 // Disallow non-null assertions in the left operand of a nullish coalescing operator
4568 // https://typescript-eslint.io/rules/no-non-null-asserted-nullish-coalescing
4569 "@typescript-eslint/no-non-null-asserted-nullish-coalescing"?: _
4570
4571 // Disallow non-null assertions after an optional chain expression
4572 // https://typescript-eslint.io/rules/no-non-null-asserted-optional-chain
4573 "@typescript-eslint/no-non-null-asserted-optional-chain"?: _
4574
4575 // Disallow non-null assertions using the `!` postfix operator
4576 // https://typescript-eslint.io/rules/no-non-null-assertion
4577 "@typescript-eslint/no-non-null-assertion"?: _
4578
4579 // Disallow variable redeclaration
4580 // https://typescript-eslint.io/rules/no-redeclare
4581 "@typescript-eslint/no-redeclare"?: matchN(1, [
4582 #ruleNumber,
4583 #ruleString,
4584 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4585 "builtinGlobals"?: bool
4586 "ignoreDeclarationMerge"?: bool
4587 ...
4588 }, ...]
4589 ])
4590
4591 // Disallow members of unions and intersections that do nothing or override type information
4592 // https://typescript-eslint.io/rules/no-redundant-type-constituents
4593 "@typescript-eslint/no-redundant-type-constituents"?: _
4594
4595 // Disallow invocation of `require()`
4596 // https://typescript-eslint.io/rules/no-require-imports
4597 "@typescript-eslint/no-require-imports"?: matchN(1, [
4598 #ruleNumber,
4599 #ruleString,
4600 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4601 // Patterns of import paths to allow requiring from.
4602 "allow"?: [...string]
4603 ...
4604 }, ...]
4605 ])
4606
4607 // Disallow specified modules when loaded by `import`
4608 // https://typescript-eslint.io/rules/no-restricted-imports
4609 "@typescript-eslint/no-restricted-imports"?: _
4610
4611 // Disallow variable declarations from shadowing variables declared in the outer scope
4612 // https://typescript-eslint.io/rules/no-shadow
4613 "@typescript-eslint/no-shadow"?: matchN(1, [
4614 #ruleNumber,
4615 #ruleString,
4616 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4617 "builtinGlobals"?: bool
4618 "hoist"?: "all" | "functions" | "never"
4619 "allow"?: [...string]
4620 "ignoreOnInitialization"?: bool
4621 "ignoreTypeValueShadow"?: bool
4622 "ignoreFunctionTypeParameterNameValueShadow"?: bool
4623 ...
4624 }, ...]
4625 ])
4626
4627 // Disallow aliasing `this`
4628 // https://typescript-eslint.io/rules/no-this-alias
4629 "@typescript-eslint/no-this-alias"?: matchN(1, [
4630 #ruleNumber,
4631 #ruleString,
4632 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4633 // Whether to ignore destructurings, such as `const { props, state } = this`.
4634 "allowDestructuring"?: bool
4635
4636 // Names to ignore, such as ["self"] for `const self = this;`.
4637 "allowedNames"?: [...string]
4638 ...
4639 }, ...]
4640 ])
4641
4642 // Disallow throwing literals as exceptions
4643 // https://typescript-eslint.io/rules/no-throw-literal
4644 "@typescript-eslint/no-throw-literal"?: matchN(1, [
4645 #ruleNumber,
4646 #ruleString,
4647 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4648 "allowThrowingAny"?: bool
4649 "allowThrowingUnknown"?: bool
4650 ...
4651 }, ...]
4652 ])
4653
4654 // Disallow type aliases
4655 // https://typescript-eslint.io/rules/no-type-alias
4656 "@typescript-eslint/no-type-alias"?: matchN(1, [
4657 #ruleNumber,
4658 #ruleString,
4659 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4660 // Whether to allow direct one-to-one type aliases.
4661 "allowAliases"?: _
4662
4663 // Whether to allow type aliases for callbacks.
4664 "allowCallbacks"?: _
4665
4666 // Whether to allow type aliases for conditional types.
4667 "allowConditionalTypes"?: _
4668
4669 // Whether to allow type aliases with constructors.
4670 "allowConstructors"?: _
4671
4672 // Whether to allow type aliases with object literal types.
4673 "allowLiterals"?: _
4674
4675 // Whether to allow type aliases with mapped types.
4676 "allowMappedTypes"?: _
4677
4678 // Whether to allow type aliases with tuple types.
4679 "allowTupleTypes"?: _
4680
4681 // Whether to allow type aliases with generic types.
4682 "allowGenerics"?: _
4683 ...
4684 }, ...]
4685 ])
4686
4687 // Disallow unnecessary equality comparisons against boolean literals
4688 // https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare
4689 "@typescript-eslint/no-unnecessary-boolean-literal-compare"?: matchN(1, [
4690 #ruleNumber,
4691 #ruleString,
4692 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4693 // Whether to allow comparisons between nullable boolean variables and `true`.
4694 "allowComparingNullableBooleansToTrue"?: bool
4695
4696 // Whether to allow comparisons between nullable boolean variables and `false`.
4697 "allowComparingNullableBooleansToFalse"?: bool
4698 ...
4699 }, ...]
4700 ])
4701
4702 // Disallow conditionals where the type is always truthy or always falsy
4703 // https://typescript-eslint.io/rules/no-unnecessary-condition
4704 "@typescript-eslint/no-unnecessary-condition"?: matchN(1, [
4705 #ruleNumber,
4706 #ruleString,
4707 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4708 // Whether to ignore constant loop conditions, such as `while (true)`.
4709 "allowConstantLoopConditions"?: bool
4710
4711 // Whether to not error when running with a tsconfig that has strictNullChecks turned.
4712 "allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing"?: bool
4713 ...
4714 }, ...]
4715 ])
4716
4717 // Disallow unnecessary namespace qualifiers
4718 // https://typescript-eslint.io/rules/no-unnecessary-qualifier
4719 "@typescript-eslint/no-unnecessary-qualifier"?: _
4720
4721 // Disallow unnecessary template expressions
4722 // https://typescript-eslint.io/rules/no-unnecessary-template-expression
4723 "@typescript-eslint/no-unnecessary-template-expression"?: _
4724
4725 // Disallow type arguments that are equal to the default
4726 // https://typescript-eslint.io/rules/no-unnecessary-type-arguments
4727 "@typescript-eslint/no-unnecessary-type-arguments"?: _
4728
4729 // Disallow type assertions that do not change the type of an expression
4730 // https://typescript-eslint.io/rules/no-unnecessary-type-assertion
4731 "@typescript-eslint/no-unnecessary-type-assertion"?: matchN(1, [
4732 #ruleNumber,
4733 #ruleString,
4734 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4735 // A list of type names to ignore.
4736 "typesToIgnore"?: [...string]
4737 ...
4738 }, ...]
4739 ])
4740
4741 // Disallow unnecessary constraints on generic types
4742 // https://typescript-eslint.io/rules/no-unnecessary-type-constraint
4743 "@typescript-eslint/no-unnecessary-type-constraint"?: _
4744
4745 // Disallow calling a function with a value with type `any`
4746 // https://typescript-eslint.io/rules/no-unsafe-argument
4747 "@typescript-eslint/no-unsafe-argument"?: _
4748
4749 // Disallow assigning a value with type `any` to variables and properties
4750 // https://typescript-eslint.io/rules/no-unsafe-assignment
4751 "@typescript-eslint/no-unsafe-assignment"?: _
4752
4753 // Disallow calling a value with type `any`
4754 // https://typescript-eslint.io/rules/no-unsafe-call
4755 "@typescript-eslint/no-unsafe-call"?: _
4756
4757 // Disallow unsafe declaration merging
4758 // https://typescript-eslint.io/rules/no-unsafe-declaration-merging
4759 "@typescript-eslint/no-unsafe-declaration-merging"?: _
4760
4761 // Disallow comparing an enum value with a non-enum value
4762 // https://typescript-eslint.io/rules/no-unsafe-enum-comparison
4763 "@typescript-eslint/no-unsafe-enum-comparison"?: _
4764
4765 // Disallow member access on a value with type `any`
4766 // https://typescript-eslint.io/rules/no-unsafe-member-access
4767 "@typescript-eslint/no-unsafe-member-access"?: _
4768
4769 // Disallow returning a value with type `any` from a function
4770 // https://typescript-eslint.io/rules/no-unsafe-return
4771 "@typescript-eslint/no-unsafe-return"?: _
4772
4773 // Require unary negation to take a number
4774 // https://typescript-eslint.io/rules/no-unsafe-unary-minus
4775 "@typescript-eslint/no-unsafe-unary-minus"?: _
4776
4777 // Disallow unused expressions
4778 // https://typescript-eslint.io/rules/no-unused-expressions
4779 "@typescript-eslint/no-unused-expressions"?: matchN(1, [
4780 #ruleNumber,
4781 #ruleString,
4782 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4783 "allowShortCircuit"?: bool
4784 "allowTernary"?: bool
4785 "allowTaggedTemplates"?: bool
4786 "enforceForJSX"?: bool
4787 ...
4788 }, ...]
4789 ])
4790
4791 // Disallow unused variables
4792 // https://typescript-eslint.io/rules/no-unused-vars
4793 "@typescript-eslint/no-unused-vars"?: matchN(1, [
4794 #ruleNumber,
4795 #ruleString,
4796 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
4797 ])
4798
4799 // Disallow the use of variables before they are defined
4800 // https://typescript-eslint.io/rules/no-use-before-define
4801 "@typescript-eslint/no-use-before-define"?: matchN(1, [
4802 #ruleNumber,
4803 #ruleString,
4804 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
4805 ])
4806
4807 // Disallow unnecessary constructors
4808 // https://typescript-eslint.io/rules/no-useless-constructor
4809 "@typescript-eslint/no-useless-constructor"?: _
4810
4811 // Disallow empty exports that don't change anything in a module file
4812 // https://typescript-eslint.io/rules/no-useless-empty-export
4813 "@typescript-eslint/no-useless-empty-export"?: _
4814
4815 // Disallow unnecessary template expressions
4816 // https://typescript-eslint.io/rules/no-useless-template-literals
4817 "@typescript-eslint/no-useless-template-literals"?: _
4818
4819 // Disallow `require` statements except in import statements
4820 // https://typescript-eslint.io/rules/no-var-requires
4821 "@typescript-eslint/no-var-requires"?: matchN(1, [
4822 #ruleNumber,
4823 #ruleString,
4824 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4825 // Patterns of import paths to allow requiring from.
4826 "allow"?: [...string]
4827 ...
4828 }, ...]
4829 ])
4830
4831 // Enforce non-null assertions over explicit type casts
4832 // https://typescript-eslint.io/rules/non-nullable-type-assertion-style
4833 "@typescript-eslint/non-nullable-type-assertion-style"?: _
4834
4835 // Enforce consistent spacing inside braces
4836 // https://typescript-eslint.io/rules/object-curly-spacing
4837 "@typescript-eslint/object-curly-spacing"?: matchN(1, [
4838 #ruleNumber,
4839 #ruleString,
4840 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
4841 ])
4842
4843 // Disallow throwing non-`Error` values as exceptions
4844 // https://typescript-eslint.io/rules/only-throw-error
4845 "@typescript-eslint/only-throw-error"?: matchN(1, [
4846 #ruleNumber,
4847 #ruleString,
4848 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4849 "allowThrowingAny"?: bool
4850 "allowThrowingUnknown"?: bool
4851 ...
4852 }, ...]
4853 ])
4854
4855 // Require or disallow padding lines between statements
4856 // https://typescript-eslint.io/rules/padding-line-between-statements
4857 "@typescript-eslint/padding-line-between-statements"?: _
4858
4859 // Require or disallow parameter properties in class constructors
4860 // https://typescript-eslint.io/rules/parameter-properties
4861 "@typescript-eslint/parameter-properties"?: matchN(1, [
4862 #ruleNumber,
4863 #ruleString,
4864 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4865 "allow"?: [..._]
4866 "prefer"?: "class-property" | "parameter-property"
4867 ...
4868 }, ...]
4869 ])
4870
4871 // Enforce the use of `as const` over literal type
4872 // https://typescript-eslint.io/rules/prefer-as-const
4873 "@typescript-eslint/prefer-as-const"?: _
4874
4875 // Require destructuring from arrays and/or objects
4876 // https://typescript-eslint.io/rules/prefer-destructuring
4877 "@typescript-eslint/prefer-destructuring"?: matchN(1, [
4878 #ruleNumber,
4879 #ruleString,
4880 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
4881 ])
4882
4883 // Require each enum member value to be explicitly initialized
4884 // https://typescript-eslint.io/rules/prefer-enum-initializers
4885 "@typescript-eslint/prefer-enum-initializers"?: _
4886
4887 // Enforce the use of Array.prototype.find() over Array.prototype.filter()
4888 // followed by [0] when looking for a single result
4889 // https://typescript-eslint.io/rules/prefer-find
4890 "@typescript-eslint/prefer-find"?: _
4891
4892 // Enforce the use of `for-of` loop over the standard `for` loop where possible
4893 // https://typescript-eslint.io/rules/prefer-for-of
4894 "@typescript-eslint/prefer-for-of"?: _
4895
4896 // Enforce using function types instead of interfaces with call signatures
4897 // https://typescript-eslint.io/rules/prefer-function-type
4898 "@typescript-eslint/prefer-function-type"?: _
4899
4900 // Enforce `includes` method over `indexOf` method
4901 // https://typescript-eslint.io/rules/prefer-includes
4902 "@typescript-eslint/prefer-includes"?: _
4903
4904 // Require all enum members to be literal values
4905 // https://typescript-eslint.io/rules/prefer-literal-enum-member
4906 "@typescript-eslint/prefer-literal-enum-member"?: matchN(1, [
4907 #ruleNumber,
4908 #ruleString,
4909 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4910 "allowBitwiseExpressions"?: bool
4911 ...
4912 }, ...]
4913 ])
4914
4915 // Require using `namespace` keyword over `module` keyword to declare custom TypeScript modules
4916 // https://typescript-eslint.io/rules/prefer-namespace-keyword
4917 "@typescript-eslint/prefer-namespace-keyword"?: _
4918
4919 // Enforce using the nullish coalescing operator instead of logical assignments or chaining
4920 // https://typescript-eslint.io/rules/prefer-nullish-coalescing
4921 "@typescript-eslint/prefer-nullish-coalescing"?: matchN(1, [
4922 #ruleNumber,
4923 #ruleString,
4924 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4925 "allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing"?: bool
4926 "ignoreConditionalTests"?: bool
4927 "ignoreMixedLogicalExpressions"?: bool
4928 "ignorePrimitives"?: matchN(1, [
4929 {
4930 "bigint"?: bool
4931 "boolean"?: bool
4932 "number"?: bool
4933 "string"?: bool
4934 ...
4935 },
4936 true
4937 ])
4938 "ignoreTernaryTests"?: bool
4939 ...
4940 }, ...]
4941 ])
4942
4943 // Enforce using concise optional chain expressions instead of chained logical
4944 // ands, negated logical ors, or empty objects
4945 // https://typescript-eslint.io/rules/prefer-optional-chain
4946 "@typescript-eslint/prefer-optional-chain"?: matchN(1, [
4947 #ruleNumber,
4948 #ruleString,
4949 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4950 // Check operands that are typed as `any` when inspecting "loose boolean" operands.
4951 "checkAny"?: bool
4952
4953 // Check operands that are typed as `unknown` when inspecting "loose boolean" operands.
4954 "checkUnknown"?: bool
4955
4956 // Check operands that are typed as `string` when inspecting "loose boolean" operands.
4957 "checkString"?: bool
4958
4959 // Check operands that are typed as `number` when inspecting "loose boolean" operands.
4960 "checkNumber"?: bool
4961
4962 // Check operands that are typed as `boolean` when inspecting "loose boolean" operands.
4963 "checkBoolean"?: bool
4964
4965 // Check operands that are typed as `bigint` when inspecting "loose boolean" operands.
4966 "checkBigInt"?: bool
4967
4968 // Skip operands that are not typed with `null` and/or `undefined` when
4969 // inspecting "loose boolean" operands.
4970 "requireNullish"?: bool
4971
4972 // Allow autofixers that will change the return type of the expression. This
4973 // option is considered unsafe as it may break the build.
4974 "allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing"?: bool
4975 ...
4976 }, ...]
4977 ])
4978
4979 // Require using Error objects as Promise rejection reasons
4980 // https://typescript-eslint.io/rules/prefer-promise-reject-errors
4981 "@typescript-eslint/prefer-promise-reject-errors"?: matchN(1, [
4982 #ruleNumber,
4983 #ruleString,
4984 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4985 "allowEmptyReject"?: bool
4986 ...
4987 }, ...]
4988 ])
4989
4990 // Require private members to be marked as `readonly` if they're never modified
4991 // outside of the constructor
4992 // https://typescript-eslint.io/rules/prefer-readonly
4993 "@typescript-eslint/prefer-readonly"?: matchN(1, [
4994 #ruleNumber,
4995 #ruleString,
4996 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
4997 "onlyInlineLambdas"?: bool
4998 ...
4999 }, ...]
5000 ])
5001
5002 // Require function parameters to be typed as `readonly` to prevent accidental mutation of inputs
5003 // https://typescript-eslint.io/rules/prefer-readonly-parameter-types
5004 "@typescript-eslint/prefer-readonly-parameter-types"?: matchN(1, [
5005 #ruleNumber,
5006 #ruleString,
5007 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5008 "allow"?: [...matchN(1, [
5009 string,
5010 close({
5011 "from"!: "file"
5012 "name"!: matchN(1, [string, list.MinItems(1) & list.UniqueItems() & [...string]])
5013 "path"?: string
5014 }), close({
5015 "from"!: "lib"
5016 "name"!: matchN(1, [string, list.MinItems(1) & list.UniqueItems() & [...string]])
5017 }), close({
5018 "from"!: "package"
5019 "name"!: matchN(1, [string, list.MinItems(1) & list.UniqueItems() & [...string]])
5020 "package"!: string
5021 })
5022 ])]
5023 "checkParameterProperties"?: bool
5024 "ignoreInferredTypes"?: bool
5025 "treatMethodsAsReadonly"?: bool
5026 ...
5027 }, ...]
5028 ])
5029
5030 // Enforce using type parameter when calling `Array#reduce` instead of casting
5031 // https://typescript-eslint.io/rules/prefer-reduce-type-parameter
5032 "@typescript-eslint/prefer-reduce-type-parameter"?: _
5033
5034 // Enforce `RegExp#exec` over `String#match` if no global flag is provided
5035 // https://typescript-eslint.io/rules/prefer-regexp-exec
5036 "@typescript-eslint/prefer-regexp-exec"?: _
5037
5038 // Enforce that `this` is used when only `this` type is returned
5039 // https://typescript-eslint.io/rules/prefer-return-this-type
5040 "@typescript-eslint/prefer-return-this-type"?: _
5041
5042 // Enforce using `String#startsWith` and `String#endsWith` over other equivalent
5043 // methods of checking substrings
5044 // https://typescript-eslint.io/rules/prefer-string-starts-ends-with
5045 "@typescript-eslint/prefer-string-starts-ends-with"?: matchN(1, [
5046 #ruleNumber,
5047 #ruleString,
5048 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5049 // Whether to allow equality checks against the first or last element of a string.
5050 "allowSingleElementEquality"?: "always" | "never"
5051 ...
5052 }, ...]
5053 ])
5054
5055 // Enforce using `@ts-expect-error` over `@ts-ignore`
5056 // https://typescript-eslint.io/rules/prefer-ts-expect-error
5057 "@typescript-eslint/prefer-ts-expect-error"?: _
5058
5059 // Require any function or method that returns a Promise to be marked async
5060 // https://typescript-eslint.io/rules/promise-function-async
5061 "@typescript-eslint/promise-function-async"?: matchN(1, [
5062 #ruleNumber,
5063 #ruleString,
5064 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5065 // Whether to consider `any` and `unknown` to be Promises.
5066 "allowAny"?: bool
5067
5068 // Any extra names of classes or interfaces to be considered Promises.
5069 "allowedPromiseNames"?: [...string]
5070 "checkArrowFunctions"?: bool
5071 "checkFunctionDeclarations"?: bool
5072 "checkFunctionExpressions"?: bool
5073 "checkMethodDeclarations"?: bool
5074 ...
5075 }, ...]
5076 ])
5077
5078 // DEPRECATED. Enforce the consistent use of either backticks, double, or single quotes
5079 // https://typescript-eslint.io/rules/quotes
5080 "@typescript-eslint/quotes"?: matchN(1, [
5081 #ruleNumber,
5082 #ruleString,
5083 matchN(1, [[
5084 matchN(1, [#ruleNumber, #ruleString]),
5085 "double" | "single" | "backtick"
5086 ], [matchN(1, [#ruleNumber, #ruleString]), "double" | "single" | "backtick", {
5087 // allows strings to use single-quotes or double-quotes so long as the string
5088 // contains a quote that would have to be escaped otherwise
5089 "avoidEscape"?: bool
5090
5091 // allows strings to use backticks
5092 "allowTemplateLiterals"?: bool
5093
5094 // Deprecated: The object property avoid-escape is deprecated; please use the
5095 // object property avoidEscape instead.
5096 "avoid-escape"?: bool
5097 ...
5098 }]])
5099 ])
5100
5101 // Require `Array#sort` and `Array#toSorted` calls to always provide a `compareFunction`
5102 // https://typescript-eslint.io/rules/require-array-sort-compare
5103 "@typescript-eslint/require-array-sort-compare"?: matchN(1, [
5104 #ruleNumber,
5105 #ruleString,
5106 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5107 // Whether to ignore arrays in which all elements are strings.
5108 "ignoreStringArrays"?: bool
5109 ...
5110 }, ...]
5111 ])
5112
5113 // Disallow async functions which do not return promises and have no `await` expression
5114 // https://typescript-eslint.io/rules/require-await
5115 "@typescript-eslint/require-await"?: _
5116
5117 // Require both operands of addition to be the same type and be `bigint`, `number`, or `string`
5118 // https://typescript-eslint.io/rules/restrict-plus-operands
5119 "@typescript-eslint/restrict-plus-operands"?: matchN(1, [
5120 #ruleNumber,
5121 #ruleString,
5122 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5123 // Whether to allow `any` typed values.
5124 "allowAny"?: bool
5125
5126 // Whether to allow `boolean` typed values.
5127 "allowBoolean"?: bool
5128
5129 // Whether to allow potentially `null` or `undefined` typed values.
5130 "allowNullish"?: bool
5131
5132 // Whether to allow `bigint`/`number` typed values and `string` typed values to be added together.
5133 "allowNumberAndString"?: bool
5134
5135 // Whether to allow `regexp` typed values.
5136 "allowRegExp"?: bool
5137
5138 // Whether to skip compound assignments such as `+=`.
5139 "skipCompoundAssignments"?: bool
5140 ...
5141 }, ...]
5142 ])
5143
5144 // Enforce template literal expressions to be of `string` type
5145 // https://typescript-eslint.io/rules/restrict-template-expressions
5146 "@typescript-eslint/restrict-template-expressions"?: matchN(1, [
5147 #ruleNumber,
5148 #ruleString,
5149 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5150 // Whether to allow `any` typed values in template expressions.
5151 "allowAny"?: bool
5152
5153 // Whether to allow `array` typed values in template expressions.
5154 "allowArray"?: bool
5155
5156 // Whether to allow `boolean` typed values in template expressions.
5157 "allowBoolean"?: bool
5158
5159 // Whether to allow `nullish` typed values in template expressions.
5160 "allowNullish"?: bool
5161
5162 // Whether to allow `number` typed values in template expressions.
5163 "allowNumber"?: bool
5164
5165 // Whether to allow `regexp` typed values in template expressions.
5166 "allowRegExp"?: bool
5167
5168 // Whether to allow `never` typed values in template expressions.
5169 "allowNever"?: bool
5170 ...
5171 }, ...]
5172 ])
5173
5174 // Enforce consistent awaiting of returned promises
5175 // https://typescript-eslint.io/rules/return-await
5176 "@typescript-eslint/return-await"?: matchN(1, [
5177 #ruleNumber,
5178 #ruleString,
5179 list.MaxItems(2) & [
5180 matchN(1, [#ruleNumber, #ruleString]), matchN(1, [
5181 "never",
5182 "error-handling-correctness-only",
5183 "in-try-catch",
5184 "always",
5185 ]),
5186 ...
5187 ]
5188 ])
5189
5190 // Require or disallow semicolons instead of ASI
5191 // https://typescript-eslint.io/rules/semi
5192 "@typescript-eslint/semi"?: _
5193
5194 // Enforce constituents of a type union/intersection to be sorted alphabetically
5195 // https://typescript-eslint.io/rules/sort-type-constituents
5196 "@typescript-eslint/sort-type-constituents"?: matchN(1, [
5197 #ruleNumber,
5198 #ruleString,
5199 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5200 // Whether to check intersection types.
5201 "checkIntersections"?: bool
5202
5203 // Whether to check union types.
5204 "checkUnions"?: bool
5205
5206 // Whether to sort using case sensitive sorting.
5207 "caseSensitive"?: bool
5208
5209 // Ordering of the groups.
5210 "groupOrder"?: [
5211 ..."conditional" |
5212 "function" |
5213 "import" |
5214 "intersection" |
5215 "keyword" |
5216 "nullish" |
5217 "literal" |
5218 "named" |
5219 "object" |
5220 "operator" |
5221 "tuple" |
5222 "union"
5223 ]
5224 ...
5225 }, ...]
5226 ])
5227
5228 // Enforce consistent spacing before blocks
5229 // https://typescript-eslint.io/rules/space-before-blocks
5230 "@typescript-eslint/space-before-blocks"?: matchN(1, [
5231 #ruleNumber,
5232 #ruleString,
5233 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
5234 ])
5235
5236 // Enforce consistent spacing before function parenthesis
5237 // https://typescript-eslint.io/rules/space-before-function-paren
5238 "@typescript-eslint/space-before-function-paren"?: matchN(1, [
5239 #ruleNumber,
5240 #ruleString,
5241 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {...}, ...]
5242 ])
5243
5244 // Require spacing around infix operators
5245 // https://typescript-eslint.io/rules/space-infix-ops
5246 "@typescript-eslint/space-infix-ops"?: matchN(1, [
5247 #ruleNumber,
5248 #ruleString,
5249 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5250 "int32Hint"?: bool
5251 ...
5252 }, ...]
5253 ])
5254
5255 // Disallow certain types in boolean expressions
5256 // https://typescript-eslint.io/rules/strict-boolean-expressions
5257 "@typescript-eslint/strict-boolean-expressions"?: matchN(1, [
5258 #ruleNumber,
5259 #ruleString,
5260 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5261 "allowString"?: bool
5262 "allowNumber"?: bool
5263 "allowNullableObject"?: bool
5264 "allowNullableBoolean"?: bool
5265 "allowNullableString"?: bool
5266 "allowNullableNumber"?: bool
5267 "allowNullableEnum"?: bool
5268 "allowAny"?: bool
5269 "allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing"?: bool
5270 ...
5271 }, ...]
5272 ])
5273
5274 // Require switch-case statements to be exhaustive
5275 // https://typescript-eslint.io/rules/switch-exhaustiveness-check
5276 "@typescript-eslint/switch-exhaustiveness-check"?: matchN(1, [
5277 #ruleNumber,
5278 #ruleString,
5279 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5280 // If 'true', allow 'default' cases on switch statements with exhaustive cases.
5281 "allowDefaultCaseForExhaustiveSwitch"?: bool
5282
5283 // If 'true', require a 'default' clause for switches on non-union types.
5284 "requireDefaultForNonUnion"?: bool
5285 ...
5286 }, ...]
5287 ])
5288
5289 // Disallow certain triple slash directives in favor of ES6-style import declarations
5290 // https://typescript-eslint.io/rules/triple-slash-reference
5291 "@typescript-eslint/triple-slash-reference"?: matchN(1, [
5292 #ruleNumber,
5293 #ruleString,
5294 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5295 "lib"?: "always" | "never"
5296 "path"?: "always" | "never"
5297 "types"?: "always" | "never" | "prefer-import"
5298 ...
5299 }, ...]
5300 ])
5301
5302 // Require consistent spacing around type annotations
5303 // https://typescript-eslint.io/rules/type-annotation-spacing
5304 "@typescript-eslint/type-annotation-spacing"?: matchN(1, [
5305 #ruleNumber,
5306 #ruleString,
5307 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5308 "before"?: bool
5309 "after"?: bool
5310 "overrides"?: close({
5311 "colon"?: _
5312 "arrow"?: _
5313 "variable"?: _
5314 "parameter"?: _
5315 "property"?: _
5316 "returnType"?: _
5317 })
5318 ...
5319 }, ...]
5320 ])
5321
5322 // Require type annotations in certain places
5323 // https://typescript-eslint.io/rules/typedef
5324 "@typescript-eslint/typedef"?: matchN(1, [
5325 #ruleNumber,
5326 #ruleString,
5327 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5328 "arrayDestructuring"?: bool
5329 "arrowParameter"?: bool
5330 "memberVariableDeclaration"?: bool
5331 "objectDestructuring"?: bool
5332 "parameter"?: bool
5333 "propertyDeclaration"?: bool
5334 "variableDeclaration"?: bool
5335 "variableDeclarationIgnoreFunction"?: bool
5336 ...
5337 }, ...]
5338 ])
5339
5340 // Enforce unbound methods are called with their expected scope
5341 // https://typescript-eslint.io/rules/unbound-method
5342 "@typescript-eslint/unbound-method"?: matchN(1, [
5343 #ruleNumber,
5344 #ruleString,
5345 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5346 // Whether to skip checking whether `static` methods are correctly bound.
5347 "ignoreStatic"?: bool
5348 ...
5349 }, ...]
5350 ])
5351
5352 // Disallow two overloads that could be unified into one with a union or an optional/rest parameter
5353 // https://typescript-eslint.io/rules/unified-signatures
5354 "@typescript-eslint/unified-signatures"?: matchN(1, [
5355 #ruleNumber,
5356 #ruleString,
5357 list.MaxItems(2) & [matchN(1, [#ruleNumber, #ruleString]), {
5358 // Whether two parameters with different names at the same index should be
5359 // considered different even if their types are the same.
5360 "ignoreDifferentlyNamedParameters"?: bool
5361 ...
5362 }, ...]
5363 ])
5364
5365 // Enforce typing arguments in `.catch()` callbacks as `unknown`
5366 // https://typescript-eslint.io/rules/use-unknown-in-catch-callback-variable
5367 "@typescript-eslint/use-unknown-in-catch-callback-variable"?: _
5368 ...
5369
5370 #pluginNames: list.UniqueItems() & [
5371 ...matchN(>=1, [
5372 "eslint-plugin-jest" |
5373 "eslint-plugin-n" |
5374 "eslint-plugin-jsx-a11y" |
5375 "eslint-plugin-react" |
5376 "eslint-plugin-unused-imports" |
5377 "eslint-plugin-react-hooks" |
5378 "eslint-plugin-import" |
5379 "eslint-plugin-security" |
5380 "eslint-plugin-unicorn" |
5381 "eslint-plugin-regexp" |
5382 "eslint-plugin-ft-flow" |
5383 "eslint-plugin-prettier" |
5384 "eslint-plugin-cypress" |
5385 "eslint-plugin-eslint-plugin" |
5386 "eslint-plugin-mocha" |
5387 "eslint-plugin-qunit" |
5388 "eslint-plugin-jasmine" |
5389 "eslint-plugin-ember" |
5390 "eslint-plugin-you-dont-need-lodash-underscore" |
5391 "@tanstack/eslint-plugin-query" |
5392 "eslint-plugin-react-perf" |
5393 "eslint-plugin-no-only-tests" |
5394 "eslint-plugin-jsdoc" |
5395 "eslint-plugin-yml" |
5396 "eslint-plugin-vue" |
5397 "eslint-plugin-jest-dom" |
5398 "eslint-plugin-simple-import-sort" |
5399 "eslint-plugin-ava" |
5400 "eslint-plugin-es-x" |
5401 "eslint-plugin-testing-library" |
5402 "eslint-plugin-i18next" |
5403 "eslint-plugin-markdown" |
5404 "eslint-plugin-local-rules" |
5405 "eslint-plugin-html" |
5406 "eslint-plugin-sonarjs" |
5407 "eslint-plugin-lodash" |
5408 "@next/eslint-plugin-next" |
5409 "eslint-plugin-perfectionist" |
5410 "eslint-plugin-canonical" |
5411 "eslint-plugin-jest-formatting" |
5412 "eslint-plugin-babel" |
5413 "eslint-plugin-tailwindcss" |
5414 "eslint-plugin-flowtype" |
5415 "eslint-plugin-lit-a11y" |
5416 "@rushstack/eslint-plugin-security" |
5417 "eslint-plugin-sort-exports" |
5418 "eslint-plugin-json" |
5419 "eslint-plugin-react-native" |
5420 "eslint-plugin-deprecation" |
5421 "eslint-plugin-vuejs-accessibility" |
5422 "eslint-plugin-chai-friendly" |
5423 "eslint-plugin-check-file" |
5424 "eslint-plugin-promise" |
5425 "eslint-plugin-sort-class-members" |
5426 "eslint-plugin-astro" |
5427 "eslint-plugin-playwright" |
5428 "eslint-plugin-typescript-sort-keys" |
5429 "eslint-plugin-react-refresh" |
5430 "eslint-plugin-jsonc" |
5431 "eslint-plugin-ban" |
5432 "eslint-plugin-tsdoc" |
5433 "eslint-plugin-vitest" |
5434 "eslint-plugin-nuxt" |
5435 "eslint-plugin-i" |
5436 "eslint-plugin-css-modules" |
5437 "eslint-plugin-no-secrets",
5438 string,
5439 ])
5440 ]
5441
5442 // ESLint rule
5443 //
5444 // 0 - turns the rule off
5445 // 1 - turn the rule on as a warning (doesn't affect exit code)
5446 // 2 - turn the rule on as an error (exit code is 1 when triggered)
5447 #ruleNumber: int & >=0 & <=2
5448
5449 // ESLint rule
5450 //
5451 // "off" - turns the rule off
5452 // "warn" - turn the rule on as a warning (doesn't affect exit code)
5453 // "error" - turn the rule on as an error (exit code is 1 when triggered)
5454 #ruleString: "off" | "warn" | "error"
5455}