@icebreakers/eslint-config 1.6.29 → 1.6.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,62 +1,2971 @@
1
- import { Awaitable, TypedFlatConfigItem, OptionsConfig, ConfigNames } from '@antfu/eslint-config';
2
- export { ConfigNames, TypedFlatConfigItem } from '@antfu/eslint-config';
3
- import { FlatConfigComposer } from 'eslint-flat-config-utils';
4
- export { FlatConfigComposer } from 'eslint-flat-config-utils';
5
- import { Linter } from 'eslint';
1
+ import { Awaitable, ConfigNames, OptionsConfig, TypedFlatConfigItem, TypedFlatConfigItem as TypedFlatConfigItem$1 } from "@antfu/eslint-config";
6
2
 
7
- interface TailwindcssOption {
3
+ //#region ../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
4
+ // ==================================================================================================
5
+ // JSON Schema Draft 04
6
+ // ==================================================================================================
7
+ /**
8
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
9
+ */
10
+ type JSONSchema4TypeName = "string" //
11
+ | "number" | "integer" | "boolean" | "object" | "array" | "null" | "any";
12
+ /**
13
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
14
+ */
15
+ type JSONSchema4Type = string //
16
+ | number | boolean | JSONSchema4Object | JSONSchema4Array | null;
17
+ // Workaround for infinite type recursion
18
+ interface JSONSchema4Object {
19
+ [key: string]: JSONSchema4Type;
20
+ }
21
+ // Workaround for infinite type recursion
22
+ // https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
23
+ interface JSONSchema4Array extends Array<JSONSchema4Type> {}
24
+ /**
25
+ * Meta schema
26
+ *
27
+ * Recommended values:
28
+ * - 'http://json-schema.org/schema#'
29
+ * - 'http://json-schema.org/hyper-schema#'
30
+ * - 'http://json-schema.org/draft-04/schema#'
31
+ * - 'http://json-schema.org/draft-04/hyper-schema#'
32
+ * - 'http://json-schema.org/draft-03/schema#'
33
+ * - 'http://json-schema.org/draft-03/hyper-schema#'
34
+ *
35
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
36
+ */
37
+ type JSONSchema4Version = string;
38
+ /**
39
+ * JSON Schema V4
40
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04
41
+ */
42
+ interface JSONSchema4 {
43
+ id?: string | undefined;
44
+ $ref?: string | undefined;
45
+ $schema?: JSONSchema4Version | undefined;
46
+ /**
47
+ * This attribute is a string that provides a short description of the
48
+ * instance property.
49
+ *
50
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
51
+ */
52
+ title?: string | undefined;
53
+ /**
54
+ * This attribute is a string that provides a full description of the of
55
+ * purpose the instance property.
56
+ *
57
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
58
+ */
59
+ description?: string | undefined;
60
+ default?: JSONSchema4Type | undefined;
61
+ multipleOf?: number | undefined;
62
+ maximum?: number | undefined;
63
+ exclusiveMaximum?: boolean | undefined;
64
+ minimum?: number | undefined;
65
+ exclusiveMinimum?: boolean | undefined;
66
+ maxLength?: number | undefined;
67
+ minLength?: number | undefined;
68
+ pattern?: string | undefined;
69
+ /**
70
+ * May only be defined when "items" is defined, and is a tuple of JSONSchemas.
71
+ *
72
+ * This provides a definition for additional items in an array instance
73
+ * when tuple definitions of the items is provided. This can be false
74
+ * to indicate additional items in the array are not allowed, or it can
75
+ * be a schema that defines the schema of the additional items.
76
+ *
77
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
78
+ */
79
+ additionalItems?: boolean | JSONSchema4 | undefined;
80
+ /**
81
+ * This attribute defines the allowed items in an instance array, and
82
+ * MUST be a schema or an array of schemas. The default value is an
83
+ * empty schema which allows any value for items in the instance array.
84
+ *
85
+ * When this attribute value is a schema and the instance value is an
86
+ * array, then all the items in the array MUST be valid according to the
87
+ * schema.
88
+ *
89
+ * When this attribute value is an array of schemas and the instance
90
+ * value is an array, each position in the instance array MUST conform
91
+ * to the schema in the corresponding position for this array. This
92
+ * called tuple typing. When tuple typing is used, additional items are
93
+ * allowed, disallowed, or constrained by the "additionalItems"
94
+ * (Section 5.6) attribute using the same rules as
95
+ * "additionalProperties" (Section 5.4) for objects.
96
+ *
97
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
98
+ */
99
+ items?: JSONSchema4 | JSONSchema4[] | undefined;
100
+ maxItems?: number | undefined;
101
+ minItems?: number | undefined;
102
+ uniqueItems?: boolean | undefined;
103
+ maxProperties?: number | undefined;
104
+ minProperties?: number | undefined;
105
+ /**
106
+ * This attribute indicates if the instance must have a value, and not
107
+ * be undefined. This is false by default, making the instance
108
+ * optional.
109
+ *
110
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
111
+ */
112
+ required?: boolean | string[] | undefined;
113
+ /**
114
+ * This attribute defines a schema for all properties that are not
115
+ * explicitly defined in an object type definition. If specified, the
116
+ * value MUST be a schema or a boolean. If false is provided, no
117
+ * additional properties are allowed beyond the properties defined in
118
+ * the schema. The default value is an empty schema which allows any
119
+ * value for additional properties.
120
+ *
121
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
122
+ */
123
+ additionalProperties?: boolean | JSONSchema4 | undefined;
124
+ definitions?: {
125
+ [k: string]: JSONSchema4;
126
+ } | undefined;
127
+ /**
128
+ * This attribute is an object with property definitions that define the
129
+ * valid values of instance object property values. When the instance
130
+ * value is an object, the property values of the instance object MUST
131
+ * conform to the property definitions in this object. In this object,
132
+ * each property definition's value MUST be a schema, and the property's
133
+ * name MUST be the name of the instance property that it defines. The
134
+ * instance property value MUST be valid according to the schema from
135
+ * the property definition. Properties are considered unordered, the
136
+ * order of the instance properties MAY be in any order.
137
+ *
138
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
139
+ */
140
+ properties?: {
141
+ [k: string]: JSONSchema4;
142
+ } | undefined;
143
+ /**
144
+ * This attribute is an object that defines the schema for a set of
145
+ * property names of an object instance. The name of each property of
146
+ * this attribute's object is a regular expression pattern in the ECMA
147
+ * 262/Perl 5 format, while the value is a schema. If the pattern
148
+ * matches the name of a property on the instance object, the value of
149
+ * the instance's property MUST be valid against the pattern name's
150
+ * schema value.
151
+ *
152
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3
153
+ */
154
+ patternProperties?: {
155
+ [k: string]: JSONSchema4;
156
+ } | undefined;
157
+ dependencies?: {
158
+ [k: string]: JSONSchema4 | string[];
159
+ } | undefined;
160
+ /**
161
+ * This provides an enumeration of all possible values that are valid
162
+ * for the instance property. This MUST be an array, and each item in
163
+ * the array represents a possible value for the instance value. If
164
+ * this attribute is defined, the instance value MUST be one of the
165
+ * values in the array in order for the schema to be valid.
166
+ *
167
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
168
+ */
169
+ enum?: JSONSchema4Type[] | undefined;
170
+ /**
171
+ * A single type, or a union of simple types
172
+ */
173
+ type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;
174
+ allOf?: JSONSchema4[] | undefined;
175
+ anyOf?: JSONSchema4[] | undefined;
176
+ oneOf?: JSONSchema4[] | undefined;
177
+ not?: JSONSchema4 | undefined;
178
+ /**
179
+ * The value of this property MUST be another schema which will provide
180
+ * a base schema which the current schema will inherit from. The
181
+ * inheritance rules are such that any instance that is valid according
182
+ * to the current schema MUST be valid according to the referenced
183
+ * schema. This MAY also be an array, in which case, the instance MUST
184
+ * be valid for all the schemas in the array. A schema that extends
185
+ * another schema MAY define additional attributes, constrain existing
186
+ * attributes, or add other constraints.
187
+ *
188
+ * Conceptually, the behavior of extends can be seen as validating an
189
+ * instance against all constraints in the extending schema as well as
190
+ * the extended schema(s).
191
+ *
192
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
193
+ */
194
+ extends?: string | string[] | undefined;
195
+ /**
196
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6
197
+ */
198
+ [k: string]: any;
199
+ format?: string | undefined;
200
+ }
201
+ //#endregion
202
+ //#region ../../node_modules/.pnpm/@eslint+core@1.1.1/node_modules/@eslint/core/dist/esm/types.d.ts
203
+ /**
204
+ * Represents an error inside of a file.
205
+ */
206
+ interface FileError {
207
+ message: string;
208
+ line: number;
209
+ column: number;
210
+ endLine?: number;
211
+ endColumn?: number;
212
+ }
213
+ /**
214
+ * Represents a problem found in a file.
215
+ */
216
+ interface FileProblem {
217
+ ruleId: string | null;
218
+ message: string;
219
+ loc: SourceLocation$2;
220
+ }
221
+ /**
222
+ * Represents the start and end coordinates of a node inside the source.
223
+ */
224
+ interface SourceLocation$2 {
225
+ start: Position$1;
226
+ end: Position$1;
227
+ }
228
+ /**
229
+ * Represents a location coordinate inside the source. ESLint-style formats
230
+ * have just `line` and `column` while others may have `offset` as well.
231
+ */
232
+ interface Position$1 {
233
+ line: number;
234
+ column: number;
235
+ }
236
+ /**
237
+ * Represents a range of characters in the source.
238
+ */
239
+ type SourceRange = [number, number];
240
+ /**
241
+ * What the rule is responsible for finding:
242
+ * - `problem` means the rule has noticed a potential error.
243
+ * - `suggestion` means the rule suggests an alternate or better approach.
244
+ * - `layout` means the rule is looking at spacing, indentation, etc.
245
+ */
246
+ type RuleType = "problem" | "suggestion" | "layout";
247
+ /**
248
+ * The type of fix the rule can provide:
249
+ * - `code` means the rule can fix syntax.
250
+ * - `whitespace` means the rule can fix spacing and indentation.
251
+ */
252
+ type RuleFixType = "code" | "whitespace";
253
+ /**
254
+ * An object containing visitor information for a rule. Each method is either the
255
+ * name of a node type or a selector, or is a method that will be called at specific
256
+ * times during the traversal.
257
+ */
258
+ type RuleVisitor$1 = Record<string, ((...args: any[]) => void) | undefined>;
259
+ /**
260
+ * Rule meta information used for documentation.
261
+ */
262
+ interface RulesMetaDocs {
263
+ /**
264
+ * A short description of the rule.
265
+ */
266
+ description?: string | undefined;
267
+ /**
268
+ * The URL to the documentation for the rule.
269
+ */
270
+ url?: string | undefined;
271
+ /**
272
+ * Indicates if the rule is generally recommended for all users.
273
+ *
274
+ * Note - this will always be a boolean for core rules, but may be used in any way by plugins.
275
+ */
276
+ recommended?: unknown;
277
+ /**
278
+ * Indicates if the rule is frozen (no longer accepting feature requests).
279
+ */
280
+ frozen?: boolean | undefined;
281
+ }
282
+ /**
283
+ * Meta information about a rule.
284
+ */
285
+ interface RulesMeta<MessageIds extends string = string, RuleOptions = unknown[], ExtRuleDocs = unknown> {
286
+ /**
287
+ * Properties that are used when documenting the rule.
288
+ */
289
+ docs?: (RulesMetaDocs & ExtRuleDocs) | undefined;
290
+ /**
291
+ * The type of rule.
292
+ */
293
+ type?: RuleType | undefined;
294
+ /**
295
+ * The schema for the rule options. Required if the rule has options.
296
+ */
297
+ schema?: JSONSchema4 | JSONSchema4[] | false | undefined;
298
+ /**
299
+ * Any default options to be recursively merged on top of any user-provided options.
300
+ */
301
+ defaultOptions?: RuleOptions;
302
+ /**
303
+ * The messages that the rule can report.
304
+ */
305
+ messages?: Record<MessageIds, string>;
306
+ /**
307
+ * Indicates whether the rule has been deprecated or provides additional metadata about the deprecation. Omit if not deprecated.
308
+ */
309
+ deprecated?: boolean | DeprecatedInfo | undefined;
310
+ /**
311
+ * @deprecated Use deprecated.replacedBy instead.
312
+ * The name of the rule(s) this rule was replaced by, if it was deprecated.
313
+ */
314
+ replacedBy?: readonly string[] | undefined;
315
+ /**
316
+ * Indicates if the rule is fixable, and if so, what type of fix it provides.
317
+ */
318
+ fixable?: RuleFixType | undefined;
319
+ /**
320
+ * Indicates if the rule may provide suggestions.
321
+ */
322
+ hasSuggestions?: boolean | undefined;
323
+ /**
324
+ * The language the rule is intended to lint.
325
+ */
326
+ language?: string;
327
+ /**
328
+ * The dialects of `language` that the rule is intended to lint.
329
+ */
330
+ dialects?: string[];
331
+ }
332
+ /**
333
+ * Provides additional metadata about a deprecation.
334
+ */
335
+ interface DeprecatedInfo {
336
+ /**
337
+ * General message presented to the user, e.g. for the key rule why the rule
338
+ * is deprecated or for info how to replace the rule.
339
+ */
340
+ message?: string;
341
+ /**
342
+ * URL to more information about this deprecation in general.
343
+ */
344
+ url?: string;
345
+ /**
346
+ * An empty array explicitly states that there is no replacement.
347
+ */
348
+ replacedBy?: ReplacedByInfo[];
349
+ /**
350
+ * The package version since when the rule is deprecated (should use full
351
+ * semver without a leading "v").
352
+ */
353
+ deprecatedSince?: string;
354
+ /**
355
+ * The estimated version when the rule is removed (probably the next major
356
+ * version). null means the rule is "frozen" (will be available but will not
357
+ * be changed).
358
+ */
359
+ availableUntil?: string | null;
360
+ }
361
+ /**
362
+ * Provides metadata about a replacement
363
+ */
364
+ interface ReplacedByInfo {
365
+ /**
366
+ * General message presented to the user, e.g. how to replace the rule
367
+ */
368
+ message?: string;
369
+ /**
370
+ * URL to more information about this replacement in general
371
+ */
372
+ url?: string;
373
+ /**
374
+ * Name should be "eslint" if the replacement is an ESLint core rule. Omit
375
+ * the property if the replacement is in the same plugin.
376
+ */
377
+ plugin?: ExternalSpecifier;
378
+ /**
379
+ * Name and documentation of the replacement rule
380
+ */
381
+ rule?: ExternalSpecifier;
382
+ }
383
+ /**
384
+ * Specifies the name and url of an external resource. At least one property
385
+ * should be set.
386
+ */
387
+ interface ExternalSpecifier {
388
+ /**
389
+ * Name of the referenced plugin / rule.
390
+ */
391
+ name?: string;
392
+ /**
393
+ * URL pointing to documentation for the plugin / rule.
394
+ */
395
+ url?: string;
396
+ }
397
+ /**
398
+ * Generic type for `RuleContext`.
399
+ */
400
+ interface RuleContextTypeOptions {
401
+ LangOptions: LanguageOptions;
402
+ Code: SourceCode$1;
403
+ RuleOptions: unknown[];
404
+ Node: unknown;
405
+ MessageIds: string;
406
+ }
407
+ /**
408
+ * Represents the context object that is passed to a rule. This object contains
409
+ * information about the current state of the linting process and is the rule's
410
+ * view into the outside world.
411
+ */
412
+ interface RuleContext$1<Options extends RuleContextTypeOptions = RuleContextTypeOptions> {
413
+ /**
414
+ * The current working directory for the session.
415
+ */
416
+ cwd: string;
417
+ /**
418
+ * The filename of the file being linted.
419
+ */
420
+ filename: string;
421
+ /**
422
+ * The physical filename of the file being linted.
423
+ */
424
+ physicalFilename: string;
425
+ /**
426
+ * The source code object that the rule is running on.
427
+ */
428
+ sourceCode: Options["Code"];
429
+ /**
430
+ * Shared settings for the configuration.
431
+ */
432
+ settings: SettingsConfig;
433
+ /**
434
+ * The language options for the configuration.
435
+ */
436
+ languageOptions: Options["LangOptions"];
437
+ /**
438
+ * The rule ID.
439
+ */
440
+ id: string;
441
+ /**
442
+ * The rule's configured options.
443
+ */
444
+ options: Options["RuleOptions"];
445
+ /**
446
+ * The report function that the rule should use to report problems.
447
+ * @param violation The violation to report.
448
+ */
449
+ report(violation: ViolationReport<Options["Node"], Options["MessageIds"]>): void;
450
+ }
451
+ /**
452
+ * Manager of text edits for a rule fix.
453
+ */
454
+ interface RuleTextEditor<EditableSyntaxElement = unknown> {
455
+ /**
456
+ * Inserts text after the specified node or token.
457
+ * @param syntaxElement The node or token to insert after.
458
+ * @param text The edit to insert after the node or token.
459
+ */
460
+ insertTextAfter(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
461
+ /**
462
+ * Inserts text after the specified range.
463
+ * @param range The range to insert after.
464
+ * @param text The edit to insert after the range.
465
+ */
466
+ insertTextAfterRange(range: SourceRange, text: string): RuleTextEdit;
467
+ /**
468
+ * Inserts text before the specified node or token.
469
+ * @param syntaxElement A syntax element with location information to insert before.
470
+ * @param text The edit to insert before the node or token.
471
+ */
472
+ insertTextBefore(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
473
+ /**
474
+ * Inserts text before the specified range.
475
+ * @param range The range to insert before.
476
+ * @param text The edit to insert before the range.
477
+ */
478
+ insertTextBeforeRange(range: SourceRange, text: string): RuleTextEdit;
479
+ /**
480
+ * Removes the specified node or token.
481
+ * @param syntaxElement A syntax element with location information to remove.
482
+ * @returns The edit to remove the node or token.
483
+ */
484
+ remove(syntaxElement: EditableSyntaxElement): RuleTextEdit;
485
+ /**
486
+ * Removes the specified range.
487
+ * @param range The range to remove.
488
+ * @returns The edit to remove the range.
489
+ */
490
+ removeRange(range: SourceRange): RuleTextEdit;
491
+ /**
492
+ * Replaces the specified node or token with the given text.
493
+ * @param syntaxElement A syntax element with location information to replace.
494
+ * @param text The text to replace the node or token with.
495
+ * @returns The edit to replace the node or token.
496
+ */
497
+ replaceText(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
498
+ /**
499
+ * Replaces the specified range with the given text.
500
+ * @param range The range to replace.
501
+ * @param text The text to replace the range with.
502
+ * @returns The edit to replace the range.
503
+ */
504
+ replaceTextRange(range: SourceRange, text: string): RuleTextEdit;
505
+ }
506
+ /**
507
+ * Represents a fix for a rule violation implemented as a text edit.
508
+ */
509
+ interface RuleTextEdit {
510
+ /**
511
+ * The range to replace.
512
+ */
513
+ range: SourceRange;
514
+ /**
515
+ * The text to insert.
516
+ */
517
+ text: string;
518
+ }
519
+ /**
520
+ * Fixes a violation.
521
+ * @param fixer The text editor to apply the fix.
522
+ * @returns The fix(es) for the violation.
523
+ */
524
+ type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
525
+ /**
526
+ * Data that can be used to fill placeholders in error messages.
527
+ */
528
+ type MessagePlaceholderData = Record<string, string | number | boolean | bigint | null | undefined>;
529
+ interface ViolationReportBase<MessageIds extends string = string> {
530
+ /**
531
+ * The data to insert into the message.
532
+ */
533
+ data?: MessagePlaceholderData | undefined;
534
+ /**
535
+ * The fix to be applied for the violation.
536
+ */
537
+ fix?: RuleFixer | null | undefined;
538
+ /**
539
+ * An array of suggested fixes for the problem. These fixes may change the
540
+ * behavior of the code, so they are not applied automatically.
541
+ */
542
+ suggest?: SuggestedEdit<MessageIds>[] | null | undefined;
543
+ }
544
+ type ViolationMessage<MessageIds extends string = string> = {
545
+ message: string;
546
+ } | {
547
+ messageId: MessageIds;
548
+ };
549
+ type ViolationLocation<Node> = {
550
+ loc: SourceLocation$2 | Position$1;
551
+ } | {
552
+ node: Node;
553
+ };
554
+ type ViolationReport<Node = unknown, MessageIds extends string = string> = ViolationReportBase<MessageIds> & ViolationMessage<MessageIds> & ViolationLocation<Node>;
555
+ interface SuggestedEditBase {
556
+ /**
557
+ * The data to insert into the message.
558
+ */
559
+ data?: MessagePlaceholderData | undefined;
560
+ /**
561
+ * The fix to be applied for the suggestion.
562
+ */
563
+ fix: RuleFixer;
564
+ }
565
+ type SuggestionMessage<MessageIds extends string = string> = {
566
+ desc: string;
567
+ } | {
568
+ messageId: MessageIds;
569
+ };
570
+ /**
571
+ * A suggested edit for a rule violation.
572
+ */
573
+ type SuggestedEdit<MessageIds extends string = string> = SuggestedEditBase & SuggestionMessage<MessageIds>;
574
+ /**
575
+ * The normalized version of a lint suggestion.
576
+ */
577
+ interface LintSuggestion {
578
+ /** A short description. */
579
+ desc: string;
580
+ /** Fix result info. */
581
+ fix: RuleTextEdit;
582
+ /** Id referencing a message for the description. */
583
+ messageId?: string | undefined;
584
+ }
585
+ /**
586
+ * The normalized version of a lint violation message.
587
+ */
588
+ interface LintMessage$1 {
589
+ /** The 1-based column number. */
590
+ column: number;
591
+ /** The 1-based line number. */
592
+ line: number;
593
+ /** The 1-based column number of the end location. */
594
+ endColumn?: number | undefined;
595
+ /** The 1-based line number of the end location. */
596
+ endLine?: number | undefined;
597
+ /** The ID of the rule which makes this message. */
598
+ ruleId: string | null;
599
+ /** The reported message. */
600
+ message: string;
601
+ /** The ID of the message in the rule's meta. */
602
+ messageId?: string | undefined;
603
+ /** If `true` then this is a fatal error. */
604
+ fatal?: true | undefined;
605
+ /** The severity of this message. */
606
+ severity: Exclude<SeverityLevel, 0>;
607
+ /** Information for autofix. */
608
+ fix?: RuleTextEdit | undefined;
609
+ /** Information for suggestions. */
610
+ suggestions?: LintSuggestion[] | undefined;
611
+ }
612
+ /**
613
+ * Generic options for the `RuleDefinition` type.
614
+ */
615
+ interface RuleDefinitionTypeOptions {
616
+ LangOptions: LanguageOptions;
617
+ Code: SourceCode$1;
618
+ RuleOptions: unknown[];
619
+ Visitor: RuleVisitor$1;
620
+ Node: unknown;
621
+ MessageIds: string;
622
+ ExtRuleDocs: unknown;
623
+ }
624
+ /**
625
+ * The definition of an ESLint rule.
626
+ */
627
+ interface RuleDefinition<Options extends RuleDefinitionTypeOptions = RuleDefinitionTypeOptions> {
628
+ /**
629
+ * The meta information for the rule.
630
+ */
631
+ meta?: RulesMeta<Options["MessageIds"], Options["RuleOptions"], Options["ExtRuleDocs"]>;
632
+ /**
633
+ * Creates the visitor that ESLint uses to apply the rule during traversal.
634
+ * @param context The rule context.
635
+ * @returns The rule visitor.
636
+ */
637
+ create(context: RuleContext$1<{
638
+ LangOptions: Options["LangOptions"];
639
+ Code: Options["Code"];
640
+ RuleOptions: Options["RuleOptions"];
641
+ Node: Options["Node"];
642
+ MessageIds: Options["MessageIds"];
643
+ }>): Options["Visitor"];
644
+ }
645
+ /**
646
+ * The human readable severity level used in a configuration.
647
+ */
648
+ type SeverityName = "off" | "warn" | "error";
649
+ /**
650
+ * The numeric severity level for a rule.
651
+ *
652
+ * - `0` means off.
653
+ * - `1` means warn.
654
+ * - `2` means error.
655
+ */
656
+ type SeverityLevel = 0 | 1 | 2;
657
+ /**
658
+ * The severity of a rule in a configuration.
659
+ */
660
+ type Severity = SeverityName | SeverityLevel;
661
+ /**
662
+ * Represents the metadata for an object, such as a plugin or processor.
663
+ */
664
+ interface ObjectMetaProperties {
665
+ /** @deprecated Use `meta.name` instead. */
666
+ name?: string | undefined;
667
+ /** @deprecated Use `meta.version` instead. */
668
+ version?: string | undefined;
669
+ meta?: {
670
+ name?: string | undefined;
671
+ version?: string | undefined;
672
+ };
673
+ }
674
+ /**
675
+ * Represents the configuration options for the core linter.
676
+ */
677
+ interface LinterOptionsConfig {
678
+ /**
679
+ * Indicates whether or not inline configuration is evaluated.
680
+ */
681
+ noInlineConfig?: boolean;
682
+ /**
683
+ * Indicates what to do when an unused disable directive is found.
684
+ */
685
+ reportUnusedDisableDirectives?: boolean | Severity;
686
+ /**
687
+ * A severity value indicating if and how unused inline configs should be
688
+ * tracked and reported.
689
+ */
690
+ reportUnusedInlineConfigs?: Severity;
691
+ }
692
+ /**
693
+ * The configuration for a rule.
694
+ */
695
+ type RuleConfig<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
696
+ /**
697
+ * A collection of rules and their configurations.
698
+ */
699
+ interface RulesConfig {
700
+ [key: string]: RuleConfig;
701
+ }
702
+ /**
703
+ * A collection of settings.
704
+ */
705
+ interface SettingsConfig {
706
+ [key: string]: unknown;
707
+ }
708
+ /**
709
+ * The configuration for a set of files.
710
+ */
711
+ interface ConfigObject<Rules extends RulesConfig = RulesConfig> {
712
+ /**
713
+ * A string to identify the configuration object. Used in error messages and
714
+ * inspection tools.
715
+ */
716
+ name?: string;
717
+ /**
718
+ * Path to the directory where the configuration object should apply.
719
+ * `files` and `ignores` patterns in the configuration object are
720
+ * interpreted as relative to this path.
721
+ */
722
+ basePath?: string;
723
+ /**
724
+ * An array of glob patterns indicating the files that the configuration
725
+ * object should apply to. If not specified, the configuration object applies
726
+ * to all files
727
+ */
728
+ files?: (string | string[])[];
729
+ /**
730
+ * An array of glob patterns indicating the files that the configuration
731
+ * object should not apply to. If not specified, the configuration object
732
+ * applies to all files matched by files
733
+ */
734
+ ignores?: string[];
735
+ /**
736
+ * The name of the language used for linting. This is used to determine the
737
+ * parser and other language-specific settings.
738
+ * @since 9.7.0
739
+ */
740
+ language?: string;
741
+ /**
742
+ * An object containing settings related to how the language is configured for
743
+ * linting.
744
+ */
745
+ languageOptions?: LanguageOptions;
746
+ /**
747
+ * An object containing settings related to the linting process
748
+ */
749
+ linterOptions?: LinterOptionsConfig;
750
+ /**
751
+ * Either an object containing preprocess() and postprocess() methods or a
752
+ * string indicating the name of a processor inside of a plugin
753
+ * (i.e., "pluginName/processorName").
754
+ */
755
+ processor?: string | Processor;
756
+ /**
757
+ * An object containing a name-value mapping of plugin names to plugin objects.
758
+ * When files is specified, these plugins are only available to the matching files.
759
+ */
760
+ plugins?: Record<string, Plugin$1>;
761
+ /**
762
+ * An object containing the configured rules. When files or ignores are specified,
763
+ * these rule configurations are only available to the matching files.
764
+ */
765
+ rules?: Partial<Rules>;
766
+ /**
767
+ * An object containing name-value pairs of information that should be
768
+ * available to all rules.
769
+ */
770
+ settings?: SettingsConfig;
771
+ }
772
+ /** @deprecated Only supported in legacy eslintrc config format. */
773
+ type GlobalAccess = boolean | "off" | "readable" | "readonly" | "writable" | "writeable";
774
+ /** @deprecated Only supported in legacy eslintrc config format. */
775
+ interface GlobalsConfig {
776
+ [name: string]: GlobalAccess;
777
+ }
778
+ /**
779
+ * The ECMAScript version of the code being linted.
780
+ * @deprecated Only supported in legacy eslintrc config format.
781
+ */
782
+ type EcmaVersion$1 = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | "latest";
783
+ /**
784
+ * The type of JavaScript source code.
785
+ * @deprecated Only supported in legacy eslintrc config format.
786
+ */
787
+ type JavaScriptSourceType = "script" | "module" | "commonjs";
788
+ /**
789
+ * Parser options.
790
+ * @deprecated Only supported in legacy eslintrc config format.
791
+ * @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options)
792
+ */
793
+ interface JavaScriptParserOptionsConfig {
794
+ /**
795
+ * Allow the use of reserved words as identifiers (if `ecmaVersion` is 3).
796
+ *
797
+ * @default false
798
+ */
799
+ allowReserved?: boolean | undefined;
800
+ /**
801
+ * Accepts any valid ECMAScript version number or `'latest'`:
802
+ *
803
+ * - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, es14, ..., or
804
+ * - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, ..., or
805
+ * - `'latest'`
806
+ *
807
+ * When it's a version or a year, the value must be a number - so do not include the `es` prefix.
808
+ *
809
+ * Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default
810
+ *
811
+ * @default 5
812
+ */
813
+ ecmaVersion?: EcmaVersion$1 | undefined;
814
+ /**
815
+ * The type of JavaScript source code. Possible values are "script" for
816
+ * traditional script files, "module" for ECMAScript modules (ESM), and
817
+ * "commonjs" for CommonJS files.
818
+ *
819
+ * @default 'script'
820
+ *
821
+ * @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
822
+ */
823
+ sourceType?: JavaScriptSourceType | undefined;
824
+ /**
825
+ * An object indicating which additional language features you'd like to use.
826
+ *
827
+ * @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
828
+ */
829
+ ecmaFeatures?: {
830
+ globalReturn?: boolean | undefined;
831
+ impliedStrict?: boolean | undefined;
832
+ jsx?: boolean | undefined;
833
+ [key: string]: any;
834
+ } | undefined;
835
+ [key: string]: any;
836
+ }
837
+ /** @deprecated Only supported in legacy eslintrc config format. */
838
+ interface EnvironmentConfig {
839
+ /** The definition of global variables. */
840
+ globals?: GlobalsConfig | undefined;
841
+ /** The parser options that will be enabled under this environment. */
842
+ parserOptions?: JavaScriptParserOptionsConfig | undefined;
843
+ }
844
+ /**
845
+ * A configuration object that may have a `rules` block.
846
+ */
847
+ interface HasRules<Rules extends RulesConfig = RulesConfig> {
848
+ rules?: Partial<Rules> | undefined;
849
+ }
850
+ /**
851
+ * ESLint legacy configuration.
852
+ *
853
+ * @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
854
+ */
855
+ interface BaseConfig<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> extends HasRules<Rules> {
856
+ $schema?: string | undefined;
857
+ /**
858
+ * An environment provides predefined global variables.
859
+ *
860
+ * @see [Environments](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-environments)
861
+ */
862
+ env?: {
863
+ [name: string]: boolean;
864
+ } | undefined;
865
+ /**
866
+ * Extending configuration files.
867
+ *
868
+ * @see [Extends](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#extending-configuration-files)
869
+ */
870
+ extends?: string | string[] | undefined;
871
+ /**
872
+ * Specifying globals.
873
+ *
874
+ * @see [Globals](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-globals)
875
+ */
876
+ globals?: GlobalsConfig | undefined;
877
+ /**
878
+ * Disable processing of inline comments.
879
+ *
880
+ * @see [Disabling Inline Comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#disabling-inline-comments)
881
+ */
882
+ noInlineConfig?: boolean | undefined;
883
+ /**
884
+ * Overrides can be used to use a differing configuration for matching sub-directories and files.
885
+ *
886
+ * @see [How do overrides work](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#how-do-overrides-work)
887
+ */
888
+ overrides?: ConfigOverride<OverrideRules>[] | undefined;
889
+ /**
890
+ * Parser.
891
+ *
892
+ * @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
893
+ * @see [Specifying Parser](https://eslint.org/docs/latest/use/configure/parser-deprecated)
894
+ */
895
+ parser?: string | undefined;
896
+ /**
897
+ * Parser options.
898
+ *
899
+ * @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
900
+ * @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options)
901
+ */
902
+ parserOptions?: JavaScriptParserOptionsConfig | undefined;
903
+ /**
904
+ * Which third-party plugins define additional rules, environments, configs, etc. for ESLint to use.
905
+ *
906
+ * @see [Configuring Plugins](https://eslint.org/docs/latest/use/configure/plugins-deprecated#configure-plugins)
907
+ */
908
+ plugins?: string[] | undefined;
909
+ /**
910
+ * Specifying processor.
911
+ *
912
+ * @see [processor](https://eslint.org/docs/latest/use/configure/plugins-deprecated#specify-a-processor)
913
+ */
914
+ processor?: string | undefined;
915
+ /**
916
+ * Report unused eslint-disable comments as warning.
917
+ *
918
+ * @see [Report unused eslint-disable comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#report-unused-eslint-disable-comments)
919
+ */
920
+ reportUnusedDisableDirectives?: boolean | undefined;
921
+ /**
922
+ * Settings.
923
+ *
924
+ * @see [Settings](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#adding-shared-settings)
925
+ */
926
+ settings?: SettingsConfig | undefined;
927
+ }
928
+ /**
929
+ * The overwrites that apply more differing configuration to specific files or directories.
930
+ */
931
+ interface ConfigOverride<Rules extends RulesConfig = RulesConfig> extends BaseConfig<Rules> {
932
+ /**
933
+ * The glob patterns for excluded files.
934
+ */
935
+ excludedFiles?: string | string[] | undefined;
936
+ /**
937
+ * The glob patterns for target files.
938
+ */
939
+ files: string | string[];
940
+ }
941
+ /**
942
+ * ESLint legacy configuration.
943
+ *
944
+ * @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
945
+ */
946
+ interface LegacyConfigObject<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> extends BaseConfig<Rules, OverrideRules> {
947
+ /**
948
+ * Tell ESLint to ignore specific files and directories.
949
+ *
950
+ * @see [Ignore Patterns](https://eslint.org/docs/latest/use/configure/ignore-deprecated#ignorepatterns-in-config-files)
951
+ */
952
+ ignorePatterns?: string | string[] | undefined;
953
+ /**
954
+ * @see [Using Configuration Files](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#using-configuration-files)
955
+ */
956
+ root?: boolean | undefined;
957
+ }
958
+ /**
959
+ * File information passed to a processor.
960
+ */
961
+ interface ProcessorFile$1 {
962
+ text: string;
963
+ filename: string;
964
+ }
965
+ /**
966
+ * A processor is an object that can preprocess and postprocess files.
967
+ */
968
+ interface Processor<T extends string | ProcessorFile$1 = string | ProcessorFile$1> extends ObjectMetaProperties {
969
+ /** If `true` then it means the processor supports autofix. */
970
+ supportsAutofix?: boolean | undefined;
971
+ /** The function to extract code blocks. */
972
+ preprocess?(text: string, filename: string): T[];
973
+ /** The function to merge messages. */
974
+ postprocess?(messages: LintMessage$1[][], filename: string): LintMessage$1[];
975
+ }
976
+ interface Plugin$1 extends ObjectMetaProperties {
977
+ meta?: ObjectMetaProperties["meta"] & {
978
+ namespace?: string | undefined;
979
+ };
980
+ configs?: Record<string, LegacyConfigObject | ConfigObject | ConfigObject[]> | undefined;
981
+ environments?: Record<string, EnvironmentConfig> | undefined;
982
+ languages?: Record<string, Language> | undefined;
983
+ processors?: Record<string, Processor> | undefined;
984
+ rules?: Record<string, RuleDefinition> | undefined;
985
+ }
986
+ /**
987
+ * Generic options for the `Language` type.
988
+ */
989
+ interface LanguageTypeOptions {
990
+ LangOptions: LanguageOptions;
991
+ Code: SourceCode$1;
992
+ RootNode: unknown;
993
+ Node: unknown;
994
+ }
995
+ /**
996
+ * Represents a plugin language.
997
+ */
998
+ interface Language<Options extends LanguageTypeOptions = {
999
+ LangOptions: LanguageOptions;
1000
+ Code: SourceCode$1;
1001
+ RootNode: unknown;
1002
+ Node: unknown;
1003
+ }> {
1004
+ /**
1005
+ * Indicates how ESLint should read the file.
1006
+ */
1007
+ fileType: "text";
1008
+ /**
1009
+ * First line number returned from the parser (text mode only).
1010
+ */
1011
+ lineStart: 0 | 1;
1012
+ /**
1013
+ * First column number returned from the parser (text mode only).
1014
+ */
1015
+ columnStart: 0 | 1;
1016
+ /**
1017
+ * The property to read the node type from. Used in selector querying.
1018
+ */
1019
+ nodeTypeKey: string;
1020
+ /**
1021
+ * The traversal path that tools should take when evaluating the AST
1022
+ */
1023
+ visitorKeys?: Record<string, string[]>;
1024
+ /**
1025
+ * Default language options. User-defined options are merged with this object.
1026
+ */
1027
+ defaultLanguageOptions?: LanguageOptions;
1028
+ /**
1029
+ * Validates languageOptions for this language.
1030
+ */
1031
+ validateLanguageOptions(languageOptions: Options["LangOptions"]): void;
1032
+ /**
1033
+ * Normalizes languageOptions for this language.
1034
+ */
1035
+ normalizeLanguageOptions?(languageOptions: Options["LangOptions"]): Options["LangOptions"];
1036
+ /**
1037
+ * Helper for esquery that allows languages to match nodes against
1038
+ * class. esquery currently has classes like `function` that will
1039
+ * match all the various function nodes. This method allows languages
1040
+ * to implement similar shorthands.
1041
+ */
1042
+ matchesSelectorClass?(className: string, node: Options["Node"], ancestry: Options["Node"][]): boolean;
1043
+ /**
1044
+ * Parses the given file input into its component parts. This file should not
1045
+ * throws errors for parsing errors but rather should return any parsing
1046
+ * errors as parse of the ParseResult object.
1047
+ */
1048
+ parse(file: File, context: LanguageContext<Options["LangOptions"]>): ParseResult<Options["RootNode"]>;
1049
+ /**
1050
+ * Creates SourceCode object that ESLint uses to work with a file.
1051
+ */
1052
+ createSourceCode(file: File, input: OkParseResult<Options["RootNode"]>, context: LanguageContext<Options["LangOptions"]>): Options["Code"];
1053
+ }
1054
+ /**
1055
+ * Plugin-defined options for the language.
1056
+ */
1057
+ type LanguageOptions = Record<string, unknown>;
1058
+ /**
1059
+ * The context object that is passed to the language plugin methods.
1060
+ */
1061
+ interface LanguageContext<LangOptions = LanguageOptions> {
1062
+ languageOptions: LangOptions;
1063
+ }
1064
+ /**
1065
+ * Represents a file read by ESLint.
1066
+ */
1067
+ interface File {
1068
+ /**
1069
+ * The path that ESLint uses for this file. May be a virtual path
1070
+ * if it was returned by a processor.
1071
+ */
1072
+ path: string;
1073
+ /**
1074
+ * The path to the file on disk. This always maps directly to a file
1075
+ * regardless of whether it was returned from a processor.
1076
+ */
1077
+ physicalPath: string;
1078
+ /**
1079
+ * Indicates if the original source contained a byte-order marker.
1080
+ * ESLint strips the BOM from the `body`, but this info is needed
1081
+ * to correctly apply autofixing.
1082
+ */
1083
+ bom: boolean;
1084
+ /**
1085
+ * The body of the file to parse.
1086
+ */
1087
+ body: string | Uint8Array;
1088
+ }
1089
+ /**
1090
+ * Represents the successful result of parsing a file.
1091
+ */
1092
+ interface OkParseResult<RootNode = unknown> {
1093
+ /**
1094
+ * Indicates if the parse was successful. If true, the parse was successful
1095
+ * and ESLint should continue on to create a SourceCode object and run rules;
1096
+ * if false, ESLint should just report the error(s) without doing anything
1097
+ * else.
1098
+ */
1099
+ ok: true;
1100
+ /**
1101
+ * The abstract syntax tree created by the parser. (only when ok: true)
1102
+ */
1103
+ ast: RootNode;
1104
+ /**
1105
+ * Any additional data that the parser wants to provide.
1106
+ */
1107
+ [key: string]: any;
1108
+ }
1109
+ /**
1110
+ * Represents the unsuccessful result of parsing a file.
1111
+ */
1112
+ interface NotOkParseResult {
1113
+ /**
1114
+ * Indicates if the parse was successful. If true, the parse was successful
1115
+ * and ESLint should continue on to create a SourceCode object and run rules;
1116
+ * if false, ESLint should just report the error(s) without doing anything
1117
+ * else.
1118
+ */
1119
+ ok: false;
1120
+ /**
1121
+ * Any parsing errors, whether fatal or not. (only when ok: false)
1122
+ */
1123
+ errors: FileError[];
1124
+ /**
1125
+ * Any additional data that the parser wants to provide.
1126
+ */
1127
+ [key: string]: any;
1128
+ }
1129
+ type ParseResult<RootNode = unknown> = OkParseResult<RootNode> | NotOkParseResult;
1130
+ /**
1131
+ * Represents inline configuration found in the source code.
1132
+ */
1133
+ interface InlineConfigElement {
1134
+ /**
1135
+ * The location of the inline config element.
1136
+ */
1137
+ loc: SourceLocation$2;
1138
+ /**
1139
+ * The interpreted configuration from the inline config element.
1140
+ */
1141
+ config: {
1142
+ rules: RulesConfig;
1143
+ };
1144
+ }
1145
+ /**
1146
+ * Generic options for the `SourceCodeBase` type.
1147
+ */
1148
+ interface SourceCodeBaseTypeOptions {
1149
+ LangOptions: LanguageOptions;
1150
+ RootNode: unknown;
1151
+ SyntaxElementWithLoc: unknown;
1152
+ ConfigNode: unknown;
1153
+ }
1154
+ /**
1155
+ * Represents the basic interface for a source code object.
1156
+ */
1157
+ interface SourceCodeBase<Options extends SourceCodeBaseTypeOptions = {
1158
+ LangOptions: LanguageOptions;
1159
+ RootNode: unknown;
1160
+ SyntaxElementWithLoc: unknown;
1161
+ ConfigNode: unknown;
1162
+ }> {
1163
+ /**
1164
+ * Root of the AST.
1165
+ */
1166
+ ast: Options["RootNode"];
1167
+ /**
1168
+ * The traversal path that tools should take when evaluating the AST.
1169
+ * When present, this overrides the `visitorKeys` on the language for
1170
+ * just this source code object.
1171
+ */
1172
+ visitorKeys?: Record<string, string[]>;
1173
+ /**
1174
+ * Retrieves the equivalent of `loc` for a given node or token.
1175
+ * @param syntaxElement The node or token to get the location for.
1176
+ * @returns The location of the node or token.
1177
+ */
1178
+ getLoc(syntaxElement: Options["SyntaxElementWithLoc"]): SourceLocation$2;
1179
+ /**
1180
+ * Retrieves the equivalent of `range` for a given node or token.
1181
+ * @param syntaxElement The node or token to get the range for.
1182
+ * @returns The range of the node or token.
1183
+ */
1184
+ getRange(syntaxElement: Options["SyntaxElementWithLoc"]): SourceRange;
1185
+ /**
1186
+ * Traversal of AST.
1187
+ */
1188
+ traverse(): Iterable<TraversalStep>;
1189
+ /**
1190
+ * Applies language options passed in from the ESLint core.
1191
+ */
1192
+ applyLanguageOptions?(languageOptions: Options["LangOptions"]): void;
1193
+ /**
1194
+ * Return all of the inline areas where ESLint should be disabled/enabled
1195
+ * along with any problems found in evaluating the directives.
1196
+ */
1197
+ getDisableDirectives?(): {
1198
+ directives: Directive$1[];
1199
+ problems: FileProblem[];
1200
+ };
1201
+ /**
1202
+ * Returns an array of all inline configuration nodes found in the
1203
+ * source code.
1204
+ */
1205
+ getInlineConfigNodes?(): Options["ConfigNode"][];
1206
+ /**
1207
+ * Applies configuration found inside of the source code. This method is only
1208
+ * called when ESLint is running with inline configuration allowed.
1209
+ */
1210
+ applyInlineConfig?(): {
1211
+ configs: InlineConfigElement[];
1212
+ problems: FileProblem[];
1213
+ };
1214
+ /**
1215
+ * Called by ESLint core to indicate that it has finished providing
1216
+ * information. We now add in all the missing variables and ensure that
1217
+ * state-changing methods cannot be called by rules.
1218
+ * @returns {void}
1219
+ */
1220
+ finalize?(): void;
1221
+ }
1222
+ /**
1223
+ * Represents the source of a text file being linted.
1224
+ */
1225
+ interface TextSourceCode<Options extends SourceCodeBaseTypeOptions = {
1226
+ LangOptions: LanguageOptions;
1227
+ RootNode: unknown;
1228
+ SyntaxElementWithLoc: unknown;
1229
+ ConfigNode: unknown;
1230
+ }> extends SourceCodeBase<Options> {
1231
+ /**
1232
+ * The body of the file that you'd like rule developers to access.
1233
+ */
1234
+ text: string;
1235
+ }
1236
+ /**
1237
+ * Represents the source of a binary file being linted.
1238
+ */
1239
+ interface BinarySourceCode<Options extends SourceCodeBaseTypeOptions = {
1240
+ LangOptions: LanguageOptions;
1241
+ RootNode: unknown;
1242
+ SyntaxElementWithLoc: unknown;
1243
+ ConfigNode: unknown;
1244
+ }> extends SourceCodeBase<Options> {
1245
+ /**
1246
+ * The body of the file that you'd like rule developers to access.
1247
+ */
1248
+ body: Uint8Array;
1249
+ }
1250
+ type SourceCode$1<Options extends SourceCodeBaseTypeOptions = {
1251
+ LangOptions: LanguageOptions;
1252
+ RootNode: unknown;
1253
+ SyntaxElementWithLoc: unknown;
1254
+ ConfigNode: unknown;
1255
+ }> = TextSourceCode<Options> | BinarySourceCode<Options>;
1256
+ /**
1257
+ * Represents a traversal step visiting the AST.
1258
+ */
1259
+ interface VisitTraversalStep {
1260
+ kind: 1;
1261
+ target: unknown;
1262
+ phase: 1 | 2;
1263
+ args: unknown[];
1264
+ }
1265
+ /**
1266
+ * Represents a traversal step calling a function.
1267
+ */
1268
+ interface CallTraversalStep {
1269
+ kind: 2;
1270
+ target: string;
1271
+ phase?: string;
1272
+ args: unknown[];
1273
+ }
1274
+ type TraversalStep = VisitTraversalStep | CallTraversalStep;
1275
+ /**
1276
+ * The type of disable directive. This determines how ESLint will disable rules.
1277
+ */
1278
+ type DirectiveType = "disable" | "enable" | "disable-line" | "disable-next-line";
1279
+ /**
1280
+ * Represents a disable directive.
1281
+ */
1282
+ interface Directive$1 {
1283
+ /**
1284
+ * The type of directive.
1285
+ */
1286
+ type: DirectiveType;
1287
+ /**
1288
+ * The node of the directive. May be in the AST or a comment/token.
1289
+ */
1290
+ node: unknown;
1291
+ /**
1292
+ * The value of the directive.
1293
+ */
1294
+ value: string;
1295
+ /**
1296
+ * The justification for the directive.
1297
+ */
1298
+ justification?: string;
1299
+ }
1300
+ //#endregion
1301
+ //#region ../../node_modules/.pnpm/@eslint+config-helpers@0.5.3/node_modules/@eslint/config-helpers/dist/esm/types.d.ts
1302
+ /**
1303
+ * Infinite array type.
1304
+ */
1305
+ type InfiniteArray<T> = T | InfiniteArray<T>[];
1306
+ /**
1307
+ * A config object that may appear inside of `extends`.
1308
+ * `basePath` and nested `extends` are not allowed on extension config objects.
1309
+ */
1310
+ type ExtensionConfigObject = Omit<ConfigObject, "basePath"> & {
1311
+ extends?: never;
1312
+ };
1313
+ /**
1314
+ * The type of array element in the `extends` property after flattening.
1315
+ */
1316
+ type SimpleExtendsElement = string | ExtensionConfigObject;
1317
+ /**
1318
+ * The type of array element in the `extends` property before flattening.
1319
+ */
1320
+ type ExtendsElement = SimpleExtendsElement | InfiniteArray<ExtensionConfigObject>;
1321
+ /**
1322
+ * Config with extends. Valid only inside of `defineConfig()`.
1323
+ */
1324
+ interface ConfigWithExtends$1 extends ConfigObject {
1325
+ extends?: ExtendsElement[];
1326
+ }
1327
+ //#endregion
1328
+ //#region ../../node_modules/.pnpm/@eslint+config-helpers@0.5.3/node_modules/@eslint/config-helpers/dist/esm/index.d.ts
1329
+ type ConfigWithExtends = ConfigWithExtends$1;
1330
+ //#endregion
1331
+ //#region ../../node_modules/.pnpm/@types+estree@1.0.8/node_modules/@types/estree/index.d.ts
1332
+ // This definition file follows a somewhat unusual format. ESTree allows
1333
+ // runtime type checks based on the `type` parameter. In order to explain this
1334
+ // to typescript we want to use discriminated union types:
1335
+ // https://github.com/Microsoft/TypeScript/pull/9163
1336
+ //
1337
+ // For ESTree this is a bit tricky because the high level interfaces like
1338
+ // Node or Function are pulling double duty. We want to pass common fields down
1339
+ // to the interfaces that extend them (like Identifier or
1340
+ // ArrowFunctionExpression), but you can't extend a type union or enforce
1341
+ // common fields on them. So we've split the high level interfaces into two
1342
+ // types, a base type which passes down inherited fields, and a type union of
1343
+ // all types which extend the base type. Only the type union is exported, and
1344
+ // the union is how other types refer to the collection of inheriting types.
1345
+ //
1346
+ // This makes the definitions file here somewhat more difficult to maintain,
1347
+ // but it has the notable advantage of making ESTree much easier to use as
1348
+ // an end user.
1349
+ interface BaseNodeWithoutComments {
1350
+ // Every leaf interface that extends BaseNode must specify a type property.
1351
+ // The type property should be a string literal. For example, Identifier
1352
+ // has: `type: "Identifier"`
1353
+ type: string;
1354
+ loc?: SourceLocation$1 | null | undefined;
1355
+ range?: [number, number] | undefined;
1356
+ }
1357
+ interface BaseNode extends BaseNodeWithoutComments {
1358
+ leadingComments?: Comment[] | undefined;
1359
+ trailingComments?: Comment[] | undefined;
1360
+ }
1361
+ interface NodeMap {
1362
+ AssignmentProperty: AssignmentProperty;
1363
+ CatchClause: CatchClause;
1364
+ Class: Class;
1365
+ ClassBody: ClassBody;
1366
+ Expression: Expression;
1367
+ Function: Function;
1368
+ Identifier: Identifier;
1369
+ Literal: Literal;
1370
+ MethodDefinition: MethodDefinition;
1371
+ ModuleDeclaration: ModuleDeclaration;
1372
+ ModuleSpecifier: ModuleSpecifier;
1373
+ Pattern: Pattern;
1374
+ PrivateIdentifier: PrivateIdentifier;
1375
+ Program: Program;
1376
+ Property: Property;
1377
+ PropertyDefinition: PropertyDefinition;
1378
+ SpreadElement: SpreadElement;
1379
+ Statement: Statement;
1380
+ Super: Super;
1381
+ SwitchCase: SwitchCase;
1382
+ TemplateElement: TemplateElement;
1383
+ VariableDeclarator: VariableDeclarator;
1384
+ }
1385
+ type Node$1 = NodeMap[keyof NodeMap];
1386
+ interface Comment extends BaseNodeWithoutComments {
1387
+ type: "Line" | "Block";
1388
+ value: string;
1389
+ }
1390
+ interface SourceLocation$1 {
1391
+ source?: string | null | undefined;
1392
+ start: Position;
1393
+ end: Position;
1394
+ }
1395
+ interface Position {
1396
+ /** >= 1 */
1397
+ line: number;
1398
+ /** >= 0 */
1399
+ column: number;
1400
+ }
1401
+ interface Program extends BaseNode {
1402
+ type: "Program";
1403
+ sourceType: "script" | "module";
1404
+ body: Array<Directive | Statement | ModuleDeclaration>;
1405
+ comments?: Comment[] | undefined;
1406
+ }
1407
+ interface Directive extends BaseNode {
1408
+ type: "ExpressionStatement";
1409
+ expression: Literal;
1410
+ directive: string;
1411
+ }
1412
+ interface BaseFunction extends BaseNode {
1413
+ params: Pattern[];
1414
+ generator?: boolean | undefined;
1415
+ async?: boolean | undefined; // The body is either BlockStatement or Expression because arrow functions
1416
+ // can have a body that's either. FunctionDeclarations and
1417
+ // FunctionExpressions have only BlockStatement bodies.
1418
+ body: BlockStatement | Expression;
1419
+ }
1420
+ type Function = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
1421
+ type Statement = ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration;
1422
+ interface BaseStatement extends BaseNode {}
1423
+ interface EmptyStatement extends BaseStatement {
1424
+ type: "EmptyStatement";
1425
+ }
1426
+ interface BlockStatement extends BaseStatement {
1427
+ type: "BlockStatement";
1428
+ body: Statement[];
1429
+ innerComments?: Comment[] | undefined;
1430
+ }
1431
+ interface StaticBlock extends Omit<BlockStatement, "type"> {
1432
+ type: "StaticBlock";
1433
+ }
1434
+ interface ExpressionStatement extends BaseStatement {
1435
+ type: "ExpressionStatement";
1436
+ expression: Expression;
1437
+ }
1438
+ interface IfStatement extends BaseStatement {
1439
+ type: "IfStatement";
1440
+ test: Expression;
1441
+ consequent: Statement;
1442
+ alternate?: Statement | null | undefined;
1443
+ }
1444
+ interface LabeledStatement extends BaseStatement {
1445
+ type: "LabeledStatement";
1446
+ label: Identifier;
1447
+ body: Statement;
1448
+ }
1449
+ interface BreakStatement extends BaseStatement {
1450
+ type: "BreakStatement";
1451
+ label?: Identifier | null | undefined;
1452
+ }
1453
+ interface ContinueStatement extends BaseStatement {
1454
+ type: "ContinueStatement";
1455
+ label?: Identifier | null | undefined;
1456
+ }
1457
+ interface WithStatement extends BaseStatement {
1458
+ type: "WithStatement";
1459
+ object: Expression;
1460
+ body: Statement;
1461
+ }
1462
+ interface SwitchStatement extends BaseStatement {
1463
+ type: "SwitchStatement";
1464
+ discriminant: Expression;
1465
+ cases: SwitchCase[];
1466
+ }
1467
+ interface ReturnStatement extends BaseStatement {
1468
+ type: "ReturnStatement";
1469
+ argument?: Expression | null | undefined;
1470
+ }
1471
+ interface ThrowStatement extends BaseStatement {
1472
+ type: "ThrowStatement";
1473
+ argument: Expression;
1474
+ }
1475
+ interface TryStatement extends BaseStatement {
1476
+ type: "TryStatement";
1477
+ block: BlockStatement;
1478
+ handler?: CatchClause | null | undefined;
1479
+ finalizer?: BlockStatement | null | undefined;
1480
+ }
1481
+ interface WhileStatement extends BaseStatement {
1482
+ type: "WhileStatement";
1483
+ test: Expression;
1484
+ body: Statement;
1485
+ }
1486
+ interface DoWhileStatement extends BaseStatement {
1487
+ type: "DoWhileStatement";
1488
+ body: Statement;
1489
+ test: Expression;
1490
+ }
1491
+ interface ForStatement extends BaseStatement {
1492
+ type: "ForStatement";
1493
+ init?: VariableDeclaration | Expression | null | undefined;
1494
+ test?: Expression | null | undefined;
1495
+ update?: Expression | null | undefined;
1496
+ body: Statement;
1497
+ }
1498
+ interface BaseForXStatement extends BaseStatement {
1499
+ left: VariableDeclaration | Pattern;
1500
+ right: Expression;
1501
+ body: Statement;
1502
+ }
1503
+ interface ForInStatement extends BaseForXStatement {
1504
+ type: "ForInStatement";
1505
+ }
1506
+ interface DebuggerStatement extends BaseStatement {
1507
+ type: "DebuggerStatement";
1508
+ }
1509
+ type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
1510
+ interface BaseDeclaration extends BaseStatement {}
1511
+ interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration {
1512
+ type: "FunctionDeclaration";
1513
+ /** It is null when a function declaration is a part of the `export default function` statement */
1514
+ id: Identifier | null;
1515
+ body: BlockStatement;
1516
+ }
1517
+ interface FunctionDeclaration extends MaybeNamedFunctionDeclaration {
1518
+ id: Identifier;
1519
+ }
1520
+ interface VariableDeclaration extends BaseDeclaration {
1521
+ type: "VariableDeclaration";
1522
+ declarations: VariableDeclarator[];
1523
+ kind: "var" | "let" | "const" | "using" | "await using";
1524
+ }
1525
+ interface VariableDeclarator extends BaseNode {
1526
+ type: "VariableDeclarator";
1527
+ id: Pattern;
1528
+ init?: Expression | null | undefined;
1529
+ }
1530
+ interface ExpressionMap {
1531
+ ArrayExpression: ArrayExpression;
1532
+ ArrowFunctionExpression: ArrowFunctionExpression;
1533
+ AssignmentExpression: AssignmentExpression;
1534
+ AwaitExpression: AwaitExpression;
1535
+ BinaryExpression: BinaryExpression;
1536
+ CallExpression: CallExpression;
1537
+ ChainExpression: ChainExpression;
1538
+ ClassExpression: ClassExpression;
1539
+ ConditionalExpression: ConditionalExpression;
1540
+ FunctionExpression: FunctionExpression;
1541
+ Identifier: Identifier;
1542
+ ImportExpression: ImportExpression;
1543
+ Literal: Literal;
1544
+ LogicalExpression: LogicalExpression;
1545
+ MemberExpression: MemberExpression;
1546
+ MetaProperty: MetaProperty;
1547
+ NewExpression: NewExpression;
1548
+ ObjectExpression: ObjectExpression;
1549
+ SequenceExpression: SequenceExpression;
1550
+ TaggedTemplateExpression: TaggedTemplateExpression;
1551
+ TemplateLiteral: TemplateLiteral;
1552
+ ThisExpression: ThisExpression;
1553
+ UnaryExpression: UnaryExpression;
1554
+ UpdateExpression: UpdateExpression;
1555
+ YieldExpression: YieldExpression;
1556
+ }
1557
+ type Expression = ExpressionMap[keyof ExpressionMap];
1558
+ interface BaseExpression extends BaseNode {}
1559
+ type ChainElement = SimpleCallExpression | MemberExpression;
1560
+ interface ChainExpression extends BaseExpression {
1561
+ type: "ChainExpression";
1562
+ expression: ChainElement;
1563
+ }
1564
+ interface ThisExpression extends BaseExpression {
1565
+ type: "ThisExpression";
1566
+ }
1567
+ interface ArrayExpression extends BaseExpression {
1568
+ type: "ArrayExpression";
1569
+ elements: Array<Expression | SpreadElement | null>;
1570
+ }
1571
+ interface ObjectExpression extends BaseExpression {
1572
+ type: "ObjectExpression";
1573
+ properties: Array<Property | SpreadElement>;
1574
+ }
1575
+ interface PrivateIdentifier extends BaseNode {
1576
+ type: "PrivateIdentifier";
1577
+ name: string;
1578
+ }
1579
+ interface Property extends BaseNode {
1580
+ type: "Property";
1581
+ key: Expression | PrivateIdentifier;
1582
+ value: Expression | Pattern; // Could be an AssignmentProperty
1583
+ kind: "init" | "get" | "set";
1584
+ method: boolean;
1585
+ shorthand: boolean;
1586
+ computed: boolean;
1587
+ }
1588
+ interface PropertyDefinition extends BaseNode {
1589
+ type: "PropertyDefinition";
1590
+ key: Expression | PrivateIdentifier;
1591
+ value?: Expression | null | undefined;
1592
+ computed: boolean;
1593
+ static: boolean;
1594
+ }
1595
+ interface FunctionExpression extends BaseFunction, BaseExpression {
1596
+ id?: Identifier | null | undefined;
1597
+ type: "FunctionExpression";
1598
+ body: BlockStatement;
1599
+ }
1600
+ interface SequenceExpression extends BaseExpression {
1601
+ type: "SequenceExpression";
1602
+ expressions: Expression[];
1603
+ }
1604
+ interface UnaryExpression extends BaseExpression {
1605
+ type: "UnaryExpression";
1606
+ operator: UnaryOperator;
1607
+ prefix: true;
1608
+ argument: Expression;
1609
+ }
1610
+ interface BinaryExpression extends BaseExpression {
1611
+ type: "BinaryExpression";
1612
+ operator: BinaryOperator;
1613
+ left: Expression | PrivateIdentifier;
1614
+ right: Expression;
1615
+ }
1616
+ interface AssignmentExpression extends BaseExpression {
1617
+ type: "AssignmentExpression";
1618
+ operator: AssignmentOperator;
1619
+ left: Pattern | MemberExpression;
1620
+ right: Expression;
1621
+ }
1622
+ interface UpdateExpression extends BaseExpression {
1623
+ type: "UpdateExpression";
1624
+ operator: UpdateOperator;
1625
+ argument: Expression;
1626
+ prefix: boolean;
1627
+ }
1628
+ interface LogicalExpression extends BaseExpression {
1629
+ type: "LogicalExpression";
1630
+ operator: LogicalOperator;
1631
+ left: Expression;
1632
+ right: Expression;
1633
+ }
1634
+ interface ConditionalExpression extends BaseExpression {
1635
+ type: "ConditionalExpression";
1636
+ test: Expression;
1637
+ alternate: Expression;
1638
+ consequent: Expression;
1639
+ }
1640
+ interface BaseCallExpression extends BaseExpression {
1641
+ callee: Expression | Super;
1642
+ arguments: Array<Expression | SpreadElement>;
1643
+ }
1644
+ type CallExpression = SimpleCallExpression | NewExpression;
1645
+ interface SimpleCallExpression extends BaseCallExpression {
1646
+ type: "CallExpression";
1647
+ optional: boolean;
1648
+ }
1649
+ interface NewExpression extends BaseCallExpression {
1650
+ type: "NewExpression";
1651
+ }
1652
+ interface MemberExpression extends BaseExpression, BasePattern {
1653
+ type: "MemberExpression";
1654
+ object: Expression | Super;
1655
+ property: Expression | PrivateIdentifier;
1656
+ computed: boolean;
1657
+ optional: boolean;
1658
+ }
1659
+ type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression;
1660
+ interface BasePattern extends BaseNode {}
1661
+ interface SwitchCase extends BaseNode {
1662
+ type: "SwitchCase";
1663
+ test?: Expression | null | undefined;
1664
+ consequent: Statement[];
1665
+ }
1666
+ interface CatchClause extends BaseNode {
1667
+ type: "CatchClause";
1668
+ param: Pattern | null;
1669
+ body: BlockStatement;
1670
+ }
1671
+ interface Identifier extends BaseNode, BaseExpression, BasePattern {
1672
+ type: "Identifier";
1673
+ name: string;
1674
+ }
1675
+ type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
1676
+ interface SimpleLiteral extends BaseNode, BaseExpression {
1677
+ type: "Literal";
1678
+ value: string | boolean | number | null;
1679
+ raw?: string | undefined;
1680
+ }
1681
+ interface RegExpLiteral extends BaseNode, BaseExpression {
1682
+ type: "Literal";
1683
+ value?: RegExp | null | undefined;
1684
+ regex: {
1685
+ pattern: string;
1686
+ flags: string;
1687
+ };
1688
+ raw?: string | undefined;
1689
+ }
1690
+ interface BigIntLiteral extends BaseNode, BaseExpression {
1691
+ type: "Literal";
1692
+ value?: bigint | null | undefined;
1693
+ bigint: string;
1694
+ raw?: string | undefined;
1695
+ }
1696
+ type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
1697
+ type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
1698
+ type LogicalOperator = "||" | "&&" | "??";
1699
+ type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
1700
+ type UpdateOperator = "++" | "--";
1701
+ interface ForOfStatement extends BaseForXStatement {
1702
+ type: "ForOfStatement";
1703
+ await: boolean;
1704
+ }
1705
+ interface Super extends BaseNode {
1706
+ type: "Super";
1707
+ }
1708
+ interface SpreadElement extends BaseNode {
1709
+ type: "SpreadElement";
1710
+ argument: Expression;
1711
+ }
1712
+ interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
1713
+ type: "ArrowFunctionExpression";
1714
+ expression: boolean;
1715
+ body: BlockStatement | Expression;
1716
+ }
1717
+ interface YieldExpression extends BaseExpression {
1718
+ type: "YieldExpression";
1719
+ argument?: Expression | null | undefined;
1720
+ delegate: boolean;
1721
+ }
1722
+ interface TemplateLiteral extends BaseExpression {
1723
+ type: "TemplateLiteral";
1724
+ quasis: TemplateElement[];
1725
+ expressions: Expression[];
1726
+ }
1727
+ interface TaggedTemplateExpression extends BaseExpression {
1728
+ type: "TaggedTemplateExpression";
1729
+ tag: Expression;
1730
+ quasi: TemplateLiteral;
1731
+ }
1732
+ interface TemplateElement extends BaseNode {
1733
+ type: "TemplateElement";
1734
+ tail: boolean;
1735
+ value: {
1736
+ /** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */cooked?: string | null | undefined;
1737
+ raw: string;
1738
+ };
1739
+ }
1740
+ interface AssignmentProperty extends Property {
1741
+ value: Pattern;
1742
+ kind: "init";
1743
+ method: boolean; // false
1744
+ }
1745
+ interface ObjectPattern extends BasePattern {
1746
+ type: "ObjectPattern";
1747
+ properties: Array<AssignmentProperty | RestElement>;
1748
+ }
1749
+ interface ArrayPattern extends BasePattern {
1750
+ type: "ArrayPattern";
1751
+ elements: Array<Pattern | null>;
1752
+ }
1753
+ interface RestElement extends BasePattern {
1754
+ type: "RestElement";
1755
+ argument: Pattern;
1756
+ }
1757
+ interface AssignmentPattern extends BasePattern {
1758
+ type: "AssignmentPattern";
1759
+ left: Pattern;
1760
+ right: Expression;
1761
+ }
1762
+ type Class = ClassDeclaration | ClassExpression;
1763
+ interface BaseClass extends BaseNode {
1764
+ superClass?: Expression | null | undefined;
1765
+ body: ClassBody;
1766
+ }
1767
+ interface ClassBody extends BaseNode {
1768
+ type: "ClassBody";
1769
+ body: Array<MethodDefinition | PropertyDefinition | StaticBlock>;
1770
+ }
1771
+ interface MethodDefinition extends BaseNode {
1772
+ type: "MethodDefinition";
1773
+ key: Expression | PrivateIdentifier;
1774
+ value: FunctionExpression;
1775
+ kind: "constructor" | "method" | "get" | "set";
1776
+ computed: boolean;
1777
+ static: boolean;
1778
+ }
1779
+ interface MaybeNamedClassDeclaration extends BaseClass, BaseDeclaration {
1780
+ type: "ClassDeclaration";
1781
+ /** It is null when a class declaration is a part of the `export default class` statement */
1782
+ id: Identifier | null;
1783
+ }
1784
+ interface ClassDeclaration extends MaybeNamedClassDeclaration {
1785
+ id: Identifier;
1786
+ }
1787
+ interface ClassExpression extends BaseClass, BaseExpression {
1788
+ type: "ClassExpression";
1789
+ id?: Identifier | null | undefined;
1790
+ }
1791
+ interface MetaProperty extends BaseExpression {
1792
+ type: "MetaProperty";
1793
+ meta: Identifier;
1794
+ property: Identifier;
1795
+ }
1796
+ type ModuleDeclaration = ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration;
1797
+ interface BaseModuleDeclaration extends BaseNode {}
1798
+ type ModuleSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier;
1799
+ interface BaseModuleSpecifier extends BaseNode {
1800
+ local: Identifier;
1801
+ }
1802
+ interface ImportDeclaration extends BaseModuleDeclaration {
1803
+ type: "ImportDeclaration";
1804
+ specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
1805
+ attributes: ImportAttribute[];
1806
+ source: Literal;
1807
+ }
1808
+ interface ImportSpecifier extends BaseModuleSpecifier {
1809
+ type: "ImportSpecifier";
1810
+ imported: Identifier | Literal;
1811
+ }
1812
+ interface ImportAttribute extends BaseNode {
1813
+ type: "ImportAttribute";
1814
+ key: Identifier | Literal;
1815
+ value: Literal;
1816
+ }
1817
+ interface ImportExpression extends BaseExpression {
1818
+ type: "ImportExpression";
1819
+ source: Expression;
1820
+ options?: Expression | null | undefined;
1821
+ }
1822
+ interface ImportDefaultSpecifier extends BaseModuleSpecifier {
1823
+ type: "ImportDefaultSpecifier";
1824
+ }
1825
+ interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
1826
+ type: "ImportNamespaceSpecifier";
1827
+ }
1828
+ interface ExportNamedDeclaration extends BaseModuleDeclaration {
1829
+ type: "ExportNamedDeclaration";
1830
+ declaration?: Declaration | null | undefined;
1831
+ specifiers: ExportSpecifier[];
1832
+ attributes: ImportAttribute[];
1833
+ source?: Literal | null | undefined;
1834
+ }
1835
+ interface ExportSpecifier extends Omit<BaseModuleSpecifier, "local"> {
1836
+ type: "ExportSpecifier";
1837
+ local: Identifier | Literal;
1838
+ exported: Identifier | Literal;
1839
+ }
1840
+ interface ExportDefaultDeclaration extends BaseModuleDeclaration {
1841
+ type: "ExportDefaultDeclaration";
1842
+ declaration: MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration | Expression;
1843
+ }
1844
+ interface ExportAllDeclaration extends BaseModuleDeclaration {
1845
+ type: "ExportAllDeclaration";
1846
+ exported: Identifier | Literal | null;
1847
+ attributes: ImportAttribute[];
1848
+ source: Literal;
1849
+ }
1850
+ interface AwaitExpression extends BaseExpression {
1851
+ type: "AwaitExpression";
1852
+ argument: Expression;
1853
+ }
1854
+ //#endregion
1855
+ //#region ../../node_modules/.pnpm/@eslint+plugin-kit@0.6.1/node_modules/@eslint/plugin-kit/dist/esm/types.d.ts
1856
+ /**
1857
+ * Adds matching `:exit` selector properties for each key of a `RuleVisitor`.
1858
+ */
1859
+ type CustomRuleVisitorWithExit$1<RuleVisitorType extends RuleVisitor$1> = { [Key in keyof RuleVisitorType as Key | `${Key & string}:exit`]: RuleVisitorType[Key] };
1860
+ //#endregion
1861
+ //#region ../../node_modules/.pnpm/@eslint+plugin-kit@0.6.1/node_modules/@eslint/plugin-kit/dist/esm/index.d.ts
1862
+ type RuleVisitor = RuleVisitor$1;
1863
+ type CustomRuleVisitorWithExit<RuleVisitorType extends RuleVisitor> = CustomRuleVisitorWithExit$1<RuleVisitorType>;
1864
+ //#endregion
1865
+ //#region ../../node_modules/.pnpm/eslint@10.0.3_jiti@2.6.1/node_modules/eslint/lib/types/index.d.ts
1866
+ //------------------------------------------------------------------------------
1867
+ // Exports
1868
+ //------------------------------------------------------------------------------
1869
+ declare namespace AST {
1870
+ type TokenType = "Boolean" | "Null" | "Identifier" | "PrivateIdentifier" | "Keyword" | "Punctuator" | "JSXIdentifier" | "JSXText" | "Numeric" | "String" | "Template" | "RegularExpression";
1871
+ interface Token {
1872
+ type: TokenType;
1873
+ value: string;
1874
+ range: Range;
1875
+ loc: SourceLocation;
1876
+ }
1877
+ interface SourceLocation {
1878
+ start: Position;
1879
+ end: Position;
1880
+ }
1881
+ type Range = SourceRange;
1882
+ interface Program extends Program {
1883
+ comments: Comment[];
1884
+ tokens: Token[];
1885
+ loc: SourceLocation;
1886
+ range: Range;
1887
+ }
1888
+ }
1889
+ interface JSXIdentifier extends BaseNode {
1890
+ type: "JSXIdentifier";
1891
+ name: string;
1892
+ }
1893
+ declare namespace Scope {
1894
+ interface ScopeManager {
1895
+ scopes: Scope[];
1896
+ globalScope: Scope | null;
1897
+ acquire(node: Node$1, inner?: boolean): Scope | null;
1898
+ getDeclaredVariables(node: Node$1): Variable[];
1899
+ addGlobals(names: ReadonlyArray<string>): void;
1900
+ }
1901
+ interface Scope {
1902
+ type: "block" | "catch" | "class" | "class-field-initializer" | "class-static-block" | "for" | "function" | "function-expression-name" | "global" | "module" | "switch" | "with";
1903
+ isStrict: boolean;
1904
+ upper: Scope | null;
1905
+ childScopes: Scope[];
1906
+ variableScope: Scope;
1907
+ block: Node$1;
1908
+ variables: Variable[];
1909
+ set: Map<string, Variable>;
1910
+ references: Reference[];
1911
+ through: Reference[];
1912
+ functionExpressionScope: boolean;
1913
+ implicit?: {
1914
+ variables: Variable[];
1915
+ set: Map<string, Variable>;
1916
+ };
1917
+ }
1918
+ interface Variable {
1919
+ name: string;
1920
+ scope: Scope;
1921
+ identifiers: Identifier[];
1922
+ references: Reference[];
1923
+ defs: Definition[];
1924
+ }
1925
+ interface Reference {
1926
+ identifier: Identifier | JSXIdentifier;
1927
+ from: Scope;
1928
+ resolved: Variable | null;
1929
+ writeExpr?: Expression | null;
1930
+ init?: boolean;
1931
+ isWrite(): boolean;
1932
+ isRead(): boolean;
1933
+ isWriteOnly(): boolean;
1934
+ isReadOnly(): boolean;
1935
+ isReadWrite(): boolean;
1936
+ }
1937
+ type DefinitionType = {
1938
+ type: "CatchClause";
1939
+ node: CatchClause;
1940
+ parent: null;
1941
+ } | {
1942
+ type: "ClassName";
1943
+ node: ClassDeclaration | ClassExpression;
1944
+ parent: null;
1945
+ } | {
1946
+ type: "FunctionName";
1947
+ node: FunctionDeclaration | FunctionExpression;
1948
+ parent: null;
1949
+ } | {
1950
+ type: "ImplicitGlobalVariable";
1951
+ node: AssignmentExpression | ForInStatement | ForOfStatement;
1952
+ parent: null;
1953
+ } | {
1954
+ type: "ImportBinding";
1955
+ node: ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier;
1956
+ parent: ImportDeclaration;
1957
+ } | {
1958
+ type: "Parameter";
1959
+ node: FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
1960
+ parent: null;
1961
+ } | {
1962
+ type: "Variable";
1963
+ node: VariableDeclarator;
1964
+ parent: VariableDeclaration;
1965
+ };
1966
+ type Definition = DefinitionType & {
1967
+ name: Identifier;
1968
+ };
1969
+ }
1970
+ // #region SourceCode
1971
+ declare class SourceCode implements TextSourceCode<{
1972
+ LangOptions: Linter.LanguageOptions;
1973
+ RootNode: AST.Program;
1974
+ SyntaxElementWithLoc: AST.Token | Node$1;
1975
+ ConfigNode: Comment;
1976
+ }> {
1977
+ text: string;
1978
+ ast: AST.Program;
1979
+ lines: string[];
1980
+ hasBOM: boolean;
1981
+ parserServices: SourceCode.ParserServices;
1982
+ scopeManager: Scope.ScopeManager;
1983
+ visitorKeys: SourceCode.VisitorKeys;
1984
+ constructor(text: string, ast: AST.Program);
1985
+ constructor(config: SourceCode.Config);
1986
+ static splitLines(text: string): string[];
1987
+ getLoc(syntaxElement: AST.Token | Node$1): SourceLocation$1;
1988
+ getRange(syntaxElement: AST.Token | Node$1): SourceRange;
1989
+ getText(node?: Node$1, beforeCount?: number, afterCount?: number): string;
1990
+ getLines(): string[];
1991
+ getAllComments(): Comment[];
1992
+ getAncestors(node: Node$1): Node$1[];
1993
+ getDeclaredVariables(node: Node$1): Scope.Variable[];
1994
+ getNodeByRangeIndex(index: number): Node$1 | null;
1995
+ getLocFromIndex(index: number): Position;
1996
+ getIndexFromLoc(location: Position): number; // Inherited methods from TokenStore
1997
+ // ---------------------------------
1998
+ getTokenByRangeStart(offset: number, options?: {
1999
+ includeComments: false;
2000
+ }): AST.Token | null;
2001
+ getTokenByRangeStart(offset: number, options: {
2002
+ includeComments: boolean;
2003
+ }): AST.Token | Comment | null;
2004
+ getFirstToken: SourceCode.UnaryNodeCursorWithSkipOptions;
2005
+ getFirstTokens: SourceCode.UnaryNodeCursorWithCountOptions;
2006
+ getLastToken: SourceCode.UnaryNodeCursorWithSkipOptions;
2007
+ getLastTokens: SourceCode.UnaryNodeCursorWithCountOptions;
2008
+ getTokenBefore: SourceCode.UnaryCursorWithSkipOptions;
2009
+ getTokensBefore: SourceCode.UnaryCursorWithCountOptions;
2010
+ getTokenAfter: SourceCode.UnaryCursorWithSkipOptions;
2011
+ getTokensAfter: SourceCode.UnaryCursorWithCountOptions;
2012
+ getFirstTokenBetween: SourceCode.BinaryCursorWithSkipOptions;
2013
+ getFirstTokensBetween: SourceCode.BinaryCursorWithCountOptions;
2014
+ getLastTokenBetween: SourceCode.BinaryCursorWithSkipOptions;
2015
+ getLastTokensBetween: SourceCode.BinaryCursorWithCountOptions;
2016
+ getTokensBetween: SourceCode.BinaryCursorWithCountOptions;
2017
+ getTokens: ((node: Node$1, beforeCount?: number, afterCount?: number) => AST.Token[]) & SourceCode.UnaryNodeCursorWithCountOptions;
2018
+ commentsExistBetween(left: Node$1 | AST.Token | Comment, right: Node$1 | AST.Token | Comment): boolean;
2019
+ getCommentsBefore(nodeOrToken: Node$1 | AST.Token): Comment[];
2020
+ getCommentsAfter(nodeOrToken: Node$1 | AST.Token): Comment[];
2021
+ getCommentsInside(node: Node$1): Comment[];
2022
+ getScope(node: Node$1): Scope.Scope;
2023
+ isSpaceBetween(first: Node$1 | AST.Token, second: Node$1 | AST.Token): boolean;
2024
+ isGlobalReference(node: Identifier): boolean;
2025
+ markVariableAsUsed(name: string, refNode?: Node$1): boolean;
2026
+ traverse(): Iterable<TraversalStep>;
2027
+ }
2028
+ declare namespace SourceCode {
2029
+ interface Config {
2030
+ text: string;
2031
+ ast: AST.Program;
2032
+ hasBOM?: boolean | undefined;
2033
+ parserServices?: ParserServices | null | undefined;
2034
+ scopeManager?: Scope.ScopeManager | null | undefined;
2035
+ visitorKeys?: VisitorKeys | null | undefined;
2036
+ }
2037
+ type ParserServices = any;
2038
+ interface VisitorKeys {
2039
+ [nodeType: string]: string[];
2040
+ }
2041
+ interface UnaryNodeCursorWithSkipOptions {
2042
+ <T extends AST.Token>(node: Node$1, options: ((token: AST.Token) => token is T) | {
2043
+ filter: (token: AST.Token) => token is T;
2044
+ includeComments?: false | undefined;
2045
+ skip?: number | undefined;
2046
+ }): T | null;
2047
+ <T extends AST.Token | Comment>(node: Node$1, options: {
2048
+ filter: (tokenOrComment: AST.Token | Comment) => tokenOrComment is T;
2049
+ includeComments: boolean;
2050
+ skip?: number | undefined;
2051
+ }): T | null;
2052
+ (node: Node$1, options?: {
2053
+ filter?: ((token: AST.Token) => boolean) | undefined;
2054
+ includeComments?: false | undefined;
2055
+ skip?: number | undefined;
2056
+ } | ((token: AST.Token) => boolean) | number): AST.Token | null;
2057
+ (node: Node$1, options: {
2058
+ filter?: ((token: AST.Token | Comment) => boolean) | undefined;
2059
+ includeComments: boolean;
2060
+ skip?: number | undefined;
2061
+ }): AST.Token | Comment | null;
2062
+ }
2063
+ interface UnaryNodeCursorWithCountOptions {
2064
+ <T extends AST.Token>(node: Node$1, options: ((token: AST.Token) => token is T) | {
2065
+ filter: (token: AST.Token) => token is T;
2066
+ includeComments?: false | undefined;
2067
+ count?: number | undefined;
2068
+ }): T[];
2069
+ <T extends AST.Token | Comment>(node: Node$1, options: {
2070
+ filter: (tokenOrComment: AST.Token | Comment) => tokenOrComment is T;
2071
+ includeComments: boolean;
2072
+ count?: number | undefined;
2073
+ }): T[];
2074
+ (node: Node$1, options?: {
2075
+ filter?: ((token: AST.Token) => boolean) | undefined;
2076
+ includeComments?: false | undefined;
2077
+ count?: number | undefined;
2078
+ } | ((token: AST.Token) => boolean) | number): AST.Token[];
2079
+ (node: Node$1, options: {
2080
+ filter?: ((token: AST.Token | Comment) => boolean) | undefined;
2081
+ includeComments: boolean;
2082
+ count?: number | undefined;
2083
+ }): Array<AST.Token | Comment>;
2084
+ }
2085
+ interface UnaryCursorWithSkipOptions {
2086
+ <T extends AST.Token>(node: Node$1 | AST.Token | Comment, options: ((token: AST.Token) => token is T) | {
2087
+ filter: (token: AST.Token) => token is T;
2088
+ includeComments?: false | undefined;
2089
+ skip?: number | undefined;
2090
+ }): T | null;
2091
+ <T extends AST.Token | Comment>(node: Node$1 | AST.Token | Comment, options: {
2092
+ filter: (tokenOrComment: AST.Token | Comment) => tokenOrComment is T;
2093
+ includeComments: boolean;
2094
+ skip?: number | undefined;
2095
+ }): T | null;
2096
+ (node: Node$1 | AST.Token | Comment, options?: {
2097
+ filter?: ((token: AST.Token) => boolean) | undefined;
2098
+ includeComments?: false | undefined;
2099
+ skip?: number | undefined;
2100
+ } | ((token: AST.Token) => boolean) | number): AST.Token | null;
2101
+ (node: Node$1 | AST.Token | Comment, options: {
2102
+ filter?: ((token: AST.Token | Comment) => boolean) | undefined;
2103
+ includeComments: boolean;
2104
+ skip?: number | undefined;
2105
+ }): AST.Token | Comment | null;
2106
+ }
2107
+ interface UnaryCursorWithCountOptions {
2108
+ <T extends AST.Token>(node: Node$1 | AST.Token | Comment, options: ((token: AST.Token) => token is T) | {
2109
+ filter: (token: AST.Token) => token is T;
2110
+ includeComments?: false | undefined;
2111
+ count?: number | undefined;
2112
+ }): T[];
2113
+ <T extends AST.Token | Comment>(node: Node$1 | AST.Token | Comment, options: {
2114
+ filter: (tokenOrComment: AST.Token | Comment) => tokenOrComment is T;
2115
+ includeComments: boolean;
2116
+ count?: number | undefined;
2117
+ }): T[];
2118
+ (node: Node$1 | AST.Token | Comment, options?: {
2119
+ filter?: ((token: AST.Token) => boolean) | undefined;
2120
+ includeComments?: false | undefined;
2121
+ count?: number | undefined;
2122
+ } | ((token: AST.Token) => boolean) | number): AST.Token[];
2123
+ (node: Node$1 | AST.Token | Comment, options: {
2124
+ filter?: ((token: AST.Token | Comment) => boolean) | undefined;
2125
+ includeComments: boolean;
2126
+ count?: number | undefined;
2127
+ }): Array<AST.Token | Comment>;
2128
+ }
2129
+ interface BinaryCursorWithSkipOptions {
2130
+ <T extends AST.Token>(left: Node$1 | AST.Token | Comment, right: Node$1 | AST.Token | Comment, options: ((token: AST.Token) => token is T) | {
2131
+ filter: (token: AST.Token) => token is T;
2132
+ includeComments?: false | undefined;
2133
+ skip?: number | undefined;
2134
+ }): T | null;
2135
+ <T extends AST.Token | Comment>(left: Node$1 | AST.Token | Comment, right: Node$1 | AST.Token | Comment, options: {
2136
+ filter: (tokenOrComment: AST.Token | Comment) => tokenOrComment is T;
2137
+ includeComments: boolean;
2138
+ skip?: number | undefined;
2139
+ }): T | null;
2140
+ (left: Node$1 | AST.Token | Comment, right: Node$1 | AST.Token | Comment, options?: {
2141
+ filter?: ((token: AST.Token) => boolean) | undefined;
2142
+ includeComments?: false | undefined;
2143
+ skip?: number | undefined;
2144
+ } | ((token: AST.Token) => boolean) | number): AST.Token | null;
2145
+ (left: Node$1 | AST.Token | Comment, right: Node$1 | AST.Token | Comment, options: {
2146
+ filter?: ((token: AST.Token | Comment) => boolean) | undefined;
2147
+ includeComments: boolean;
2148
+ skip?: number | undefined;
2149
+ }): AST.Token | Comment | null;
2150
+ }
2151
+ interface BinaryCursorWithCountOptions {
2152
+ <T extends AST.Token>(left: Node$1 | AST.Token | Comment, right: Node$1 | AST.Token | Comment, options: ((token: AST.Token) => token is T) | {
2153
+ filter: (token: AST.Token) => token is T;
2154
+ includeComments?: false | undefined;
2155
+ count?: number | undefined;
2156
+ }): T[];
2157
+ <T extends AST.Token | Comment>(left: Node$1 | AST.Token | Comment, right: Node$1 | AST.Token | Comment, options: {
2158
+ filter: (tokenOrComment: AST.Token | Comment) => tokenOrComment is T;
2159
+ includeComments: boolean;
2160
+ count?: number | undefined;
2161
+ }): T[];
2162
+ (left: Node$1 | AST.Token | Comment, right: Node$1 | AST.Token | Comment, options?: {
2163
+ filter?: ((token: AST.Token) => boolean) | undefined;
2164
+ includeComments?: false | undefined;
2165
+ count?: number | undefined;
2166
+ } | ((token: AST.Token) => boolean) | number): AST.Token[];
2167
+ (left: Node$1 | AST.Token | Comment, right: Node$1 | AST.Token | Comment, options: {
2168
+ filter?: ((token: AST.Token | Comment) => boolean) | undefined;
2169
+ includeComments: boolean;
2170
+ count?: number | undefined;
2171
+ }): Array<AST.Token | Comment>;
2172
+ }
2173
+ }
2174
+ // #endregion
2175
+ type JSSyntaxElement = {
2176
+ type: string;
2177
+ loc?: SourceLocation$1 | null | undefined;
2178
+ };
2179
+ declare namespace Rule {
2180
+ interface RuleModule extends RuleDefinition<{
2181
+ LangOptions: Linter.LanguageOptions;
2182
+ Code: SourceCode;
2183
+ RuleOptions: any[];
2184
+ Visitor: RuleListener;
2185
+ Node: JSSyntaxElement;
2186
+ MessageIds: string;
2187
+ ExtRuleDocs: {};
2188
+ }> {
2189
+ create(context: RuleContext): RuleListener;
2190
+ }
2191
+ type NodeTypes = Node$1["type"];
2192
+ interface NodeListener extends CustomRuleVisitorWithExit<{ [Node in Rule.Node as Node["type"]]?: ((node: Node) => void) | undefined } & {
2193
+ // A `Program` visitor's node type has no `parent` property.
2194
+ Program?: ((node: AST.Program) => void) | undefined;
2195
+ }> {}
2196
+ interface NodeParentExtension {
2197
+ parent: Node;
2198
+ }
2199
+ type Node = (AST.Program & {
2200
+ parent: null;
2201
+ }) | (Exclude<Node$1, Program> & NodeParentExtension);
2202
+ interface RuleListener extends NodeListener {
2203
+ onCodePathStart?(codePath: CodePath, node: Node): void;
2204
+ onCodePathEnd?(codePath: CodePath, node: Node): void;
2205
+ onCodePathSegmentStart?(segment: CodePathSegment, node: Node): void;
2206
+ onCodePathSegmentEnd?(segment: CodePathSegment, node: Node): void;
2207
+ onUnreachableCodePathSegmentStart?(segment: CodePathSegment, node: Node): void;
2208
+ onUnreachableCodePathSegmentEnd?(segment: CodePathSegment, node: Node): void;
2209
+ onCodePathSegmentLoop?(fromSegment: CodePathSegment, toSegment: CodePathSegment, node: Node): void;
2210
+ [key: string]: ((codePath: CodePath, node: Node) => void) | ((segment: CodePathSegment, node: Node) => void) | ((fromSegment: CodePathSegment, toSegment: CodePathSegment, node: Node) => void) | ((node: Node) => void) | NodeListener[keyof NodeListener] | undefined;
2211
+ }
2212
+ type CodePathOrigin = "program" | "function" | "class-field-initializer" | "class-static-block";
2213
+ interface CodePath {
2214
+ id: string;
2215
+ origin: CodePathOrigin;
2216
+ initialSegment: CodePathSegment;
2217
+ finalSegments: CodePathSegment[];
2218
+ returnedSegments: CodePathSegment[];
2219
+ thrownSegments: CodePathSegment[];
2220
+ upper: CodePath | null;
2221
+ childCodePaths: CodePath[];
2222
+ }
2223
+ interface CodePathSegment {
2224
+ id: string;
2225
+ nextSegments: CodePathSegment[];
2226
+ prevSegments: CodePathSegment[];
2227
+ reachable: boolean;
2228
+ }
2229
+ type RuleMetaData = RulesMeta;
2230
+ interface RuleContext extends RuleContext$1<{
2231
+ LangOptions: Linter.LanguageOptions;
2232
+ Code: SourceCode;
2233
+ RuleOptions: any[];
2234
+ Node: JSSyntaxElement;
2235
+ MessageIds: string;
2236
+ }> {}
2237
+ type ReportFixer = RuleFixer;
2238
+ /** @deprecated Use `ReportDescriptorOptions` instead. */
2239
+ type ReportDescriptorOptionsBase = Omit<ViolationReportBase, "suggest">;
2240
+ type SuggestionReportOptions = SuggestedEditBase;
2241
+ type SuggestionDescriptorMessage = SuggestionMessage;
2242
+ type SuggestionReportDescriptor = SuggestedEdit; // redundant with ReportDescriptorOptionsBase but kept for clarity
2243
+ type ReportDescriptorOptions = ViolationReportBase;
2244
+ type ReportDescriptor = ViolationReport<JSSyntaxElement>;
2245
+ type ReportDescriptorMessage = ViolationMessage;
2246
+ type ReportDescriptorLocation = ViolationLocation<JSSyntaxElement>;
2247
+ type RuleFixer = RuleTextEditor<Node$1 | AST.Token>;
2248
+ type Fix = RuleTextEdit;
2249
+ }
2250
+ // #region Linter
2251
+ declare class Linter {
2252
+ static readonly version: string;
2253
+ version: string;
2254
+ constructor(options?: {
2255
+ cwd?: string | undefined;
2256
+ configType?: "flat";
2257
+ });
2258
+ verify(code: SourceCode | string, config: Linter.Config | Linter.Config[], filename?: string): Linter.LintMessage[];
2259
+ verify(code: SourceCode | string, config: Linter.Config | Linter.Config[], options: Linter.LintOptions): Linter.LintMessage[];
2260
+ verifyAndFix(code: string, config: Linter.Config | Linter.Config[], filename?: string): Linter.FixReport;
2261
+ verifyAndFix(code: string, config: Linter.Config | Linter.Config[], options: Linter.FixOptions): Linter.FixReport;
2262
+ getSourceCode(): SourceCode;
2263
+ getTimes(): Linter.Stats["times"];
2264
+ getFixPassCount(): Linter.Stats["fixPasses"];
2265
+ }
2266
+ declare namespace Linter {
2267
+ /**
2268
+ * The numeric severity level for a rule.
2269
+ *
2270
+ * - `0` means off.
2271
+ * - `1` means warn.
2272
+ * - `2` means error.
2273
+ *
2274
+ * @see [Rule Severities](https://eslint.org/docs/latest/use/configure/rules#rule-severities)
2275
+ */
2276
+ type Severity = SeverityLevel;
2277
+ /**
2278
+ * The human readable severity level for a rule.
2279
+ *
2280
+ * @see [Rule Severities](https://eslint.org/docs/latest/use/configure/rules#rule-severities)
2281
+ */
2282
+ type StringSeverity = SeverityName;
2283
+ /**
2284
+ * The numeric or human readable severity level for a rule.
2285
+ *
2286
+ * @see [Rule Severities](https://eslint.org/docs/latest/use/configure/rules#rule-severities)
2287
+ */
2288
+ type RuleSeverity = Severity;
2289
+ /**
2290
+ * An array containing the rule severity level, followed by the rule options.
2291
+ *
2292
+ * @see [Rules](https://eslint.org/docs/latest/use/configure/rules)
2293
+ */
2294
+ type RuleSeverityAndOptions<Options extends any[] = any[]> = [RuleSeverity, ...Partial<Options>];
2295
+ /**
2296
+ * The severity level for the rule or an array containing the rule severity level, followed by the rule options.
2297
+ *
2298
+ * @see [Rules](https://eslint.org/docs/latest/use/configure/rules)
2299
+ */
2300
+ type RuleEntry<Options extends any[] = any[]> = RuleConfig<Options>;
2301
+ /**
2302
+ * The rules config object is a key/value map of rule names and their severity and options.
2303
+ */
2304
+ type RulesRecord = RulesConfig;
2305
+ /**
2306
+ * A configuration object that may have a `rules` block.
2307
+ */
2308
+ type HasRules<Rules extends RulesConfig = RulesConfig> = HasRules<Rules>;
2309
+ /**
2310
+ * The ECMAScript version of the code being linted.
2311
+ */
2312
+ type EcmaVersion = EcmaVersion$1;
2313
+ /**
2314
+ * The type of JavaScript source code.
2315
+ */
2316
+ type SourceType = JavaScriptSourceType;
2317
+ /**
2318
+ * ESLint legacy configuration.
2319
+ *
2320
+ * @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
2321
+ */
2322
+ type BaseConfig<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> = BaseConfig<Rules, OverrideRules>;
2323
+ /**
2324
+ * The overwrites that apply more differing configuration to specific files or directories.
2325
+ */
2326
+ type ConfigOverride<Rules extends RulesConfig = RulesConfig> = ConfigOverride<Rules>;
2327
+ /**
2328
+ * ESLint legacy configuration.
2329
+ *
2330
+ * @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
2331
+ */
2332
+ // https://github.com/eslint/eslint/blob/v8.57.0/conf/config-schema.js
2333
+ type LegacyConfig<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> = LegacyConfigObject<Rules, OverrideRules>;
2334
+ /**
2335
+ * Parser options.
2336
+ *
2337
+ * @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options)
2338
+ */
2339
+ interface ParserOptions {
2340
+ /**
2341
+ * Allow the use of reserved words as identifiers (if `ecmaVersion` is 3).
2342
+ *
2343
+ * @default false
2344
+ */
2345
+ allowReserved?: boolean | undefined;
2346
+ /**
2347
+ * An object indicating which additional language features you'd like to use.
2348
+ *
2349
+ * @see https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options
2350
+ */
2351
+ ecmaFeatures?: {
2352
+ /**
2353
+ * Allow `return` statements in the global scope.
2354
+ *
2355
+ * @default false
2356
+ */
2357
+ globalReturn?: boolean | undefined;
2358
+ /**
2359
+ * Enable global [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) (if `ecmaVersion` is 5 or greater).
2360
+ *
2361
+ * @default false
2362
+ */
2363
+ impliedStrict?: boolean | undefined;
2364
+ /**
2365
+ * Enable [JSX](https://facebook.github.io/jsx/).
2366
+ *
2367
+ * @default false
2368
+ */
2369
+ jsx?: boolean | undefined;
2370
+ [key: string]: any;
2371
+ } | undefined;
2372
+ [key: string]: any;
2373
+ }
2374
+ /**
2375
+ * Options used for linting code with `Linter#verify` and `Linter#verifyAndFix`.
2376
+ */
2377
+ interface LintOptions {
2378
+ filename?: string | undefined;
2379
+ preprocess?: ((code: string) => string[]) | undefined;
2380
+ postprocess?: ((problemLists: LintMessage[][]) => LintMessage[]) | undefined;
2381
+ filterCodeBlock?: ((filename: string, text: string) => boolean) | undefined;
2382
+ disableFixes?: boolean | undefined;
2383
+ allowInlineConfig?: boolean | undefined;
2384
+ reportUnusedDisableDirectives?: boolean | undefined;
2385
+ }
2386
+ type LintSuggestion = LintSuggestion;
2387
+ type LintMessage = LintMessage$1;
2388
+ interface LintSuppression {
2389
+ kind: string;
2390
+ justification: string;
2391
+ }
2392
+ interface SuppressedLintMessage extends LintMessage {
2393
+ /** The suppression info. */
2394
+ suppressions: LintSuppression[];
2395
+ }
2396
+ interface FixOptions extends LintOptions {
2397
+ fix?: boolean | undefined;
2398
+ }
2399
+ interface FixReport {
2400
+ fixed: boolean;
2401
+ output: string;
2402
+ messages: LintMessage[];
2403
+ } // Temporarily loosen type for just flat config files (see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/68232)
2404
+ type NonESTreeParser = ESLint.ObjectMetaProperties & ({
2405
+ parse(text: string, options?: any): unknown;
2406
+ } | {
2407
+ parseForESLint(text: string, options?: any): Omit<ESLintParseResult, "ast" | "scopeManager"> & {
2408
+ ast: unknown;
2409
+ scopeManager?: unknown;
2410
+ };
2411
+ });
2412
+ type ESTreeParser = ESLint.ObjectMetaProperties & ({
2413
+ parse(text: string, options?: any): AST.Program;
2414
+ } | {
2415
+ parseForESLint(text: string, options?: any): ESLintParseResult;
2416
+ });
2417
+ type Parser = NonESTreeParser | ESTreeParser;
2418
+ interface ESLintParseResult {
2419
+ /** The AST object. */
2420
+ ast: AST.Program;
2421
+ /** The services that the parser provides. */
2422
+ services?: SourceCode.ParserServices | undefined;
2423
+ /** The scope manager of the AST. */
2424
+ scopeManager?: Scope.ScopeManager | undefined;
2425
+ /** The visitor keys of the AST. */
2426
+ visitorKeys?: SourceCode.VisitorKeys | undefined;
2427
+ }
2428
+ type ProcessorFile = ProcessorFile$1; // https://eslint.org/docs/latest/extend/plugins#processors-in-plugins
2429
+ type Processor<T extends string | ProcessorFile = string | ProcessorFile> = Processor<T>;
2430
+ type Config<Rules extends RulesConfig = RulesConfig> = ConfigObject<Rules>;
2431
+ /** @deprecated Use `Config` instead of `FlatConfig` */
2432
+ type FlatConfig<Rules extends RulesConfig = RulesConfig> = Config<Rules>;
2433
+ type GlobalConf = GlobalAccess;
2434
+ type Globals = GlobalsConfig;
2435
+ interface LanguageOptions extends LanguageOptions {
2436
+ /**
2437
+ * The version of ECMAScript to support. May be any year (i.e., 2022) or
2438
+ * version (i.e., 5). Set to "latest" for the most recent supported version.
2439
+ * @default "latest"
2440
+ */
2441
+ ecmaVersion?: EcmaVersion | undefined;
2442
+ /**
2443
+ * The type of JavaScript source code. Possible values are "script" for
2444
+ * traditional script files, "module" for ECMAScript modules (ESM), and
2445
+ * "commonjs" for CommonJS files. (default: "module" for .js and .mjs
2446
+ * files; "commonjs" for .cjs files)
2447
+ */
2448
+ sourceType?: SourceType | undefined;
2449
+ /**
2450
+ * An object specifying additional objects that should be added to the
2451
+ * global scope during linting.
2452
+ */
2453
+ globals?: Globals | undefined;
2454
+ /**
2455
+ * An object containing a parse() or parseForESLint() method.
2456
+ * If not configured, the default ESLint parser (Espree) will be used.
2457
+ */
2458
+ parser?: Parser | undefined;
2459
+ /**
2460
+ * An object specifying additional options that are passed directly to the
2461
+ * parser() method on the parser. The available options are parser-dependent
2462
+ */
2463
+ parserOptions?: Linter.ParserOptions | undefined;
2464
+ }
2465
+ type LinterOptions = LinterOptionsConfig;
2466
+ /**
2467
+ * Performance statistics.
2468
+ */
2469
+ interface Stats {
2470
+ /**
2471
+ * The number of times ESLint has applied at least one fix after linting.
2472
+ */
2473
+ fixPasses: number;
2474
+ /**
2475
+ * The times spent on (parsing, fixing, linting) a file, where the linting refers to the timing information for each rule.
2476
+ */
2477
+ times: {
2478
+ passes: TimePass[];
2479
+ };
2480
+ }
2481
+ interface TimePass {
8
2482
  /**
9
- * Tailwind CSS v4 entry point, e.g. `src/global.css`.
2483
+ * The parse object containing all parse time information.
10
2484
  */
11
- entryPoint?: string;
2485
+ parse: {
2486
+ total: number;
2487
+ };
12
2488
  /**
13
- * Tailwind CSS v3 config file path, e.g. `tailwind.config.js`.
2489
+ * The rules object containing all lint time information for each rule.
14
2490
  */
15
- tailwindConfig?: string;
2491
+ rules?: Record<string, {
2492
+ total: number;
2493
+ }>;
2494
+ /**
2495
+ * The fix object containing all fix time information.
2496
+ */
2497
+ fix: {
2498
+ total: number;
2499
+ };
2500
+ /**
2501
+ * The total time that is spent on (parsing, fixing, linting) a file.
2502
+ */
2503
+ total: number;
2504
+ }
16
2505
  }
17
- type TailwindcssConfig = boolean | TailwindcssOption;
18
- type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
2506
+ // #endregion
2507
+ // #region ESLint
2508
+ declare class ESLint {
2509
+ static configType: "flat";
2510
+ static readonly version: string;
2511
+ /**
2512
+ * The default configuration that ESLint uses internally. This is provided for tooling that wants to calculate configurations using the same defaults as ESLint.
2513
+ * Keep in mind that the default configuration may change from version to version, so you shouldn't rely on any particular keys or values to be present.
2514
+ */
2515
+ static readonly defaultConfig: Linter.Config[];
2516
+ static outputFixes(results: ESLint.LintResult[]): Promise<void>;
2517
+ static getErrorResults(results: ESLint.LintResult[]): ESLint.LintResult[];
2518
+ constructor(options?: ESLint.Options);
2519
+ lintFiles(patterns: string | string[]): Promise<ESLint.LintResult[]>;
2520
+ lintText(code: string, options?: {
2521
+ filePath?: string | undefined;
2522
+ warnIgnored?: boolean | undefined;
2523
+ }): Promise<ESLint.LintResult[]>;
2524
+ getRulesMetaForResults(results: ESLint.LintResult[]): ESLint.LintResultData["rulesMeta"];
2525
+ hasFlag(flag: string): boolean;
2526
+ calculateConfigForFile(filePath: string): Promise<any>;
2527
+ findConfigFile(filePath?: string): Promise<string | undefined>;
2528
+ isPathIgnored(filePath: string): Promise<boolean>;
2529
+ loadFormatter(nameOrPath?: string): Promise<ESLint.LoadedFormatter>;
2530
+ static fromOptionsModule(optionsURL: {
2531
+ readonly href: string;
2532
+ }): Promise<ESLint>;
2533
+ }
2534
+ declare namespace ESLint {
2535
+ type ConfigData<Rules extends Linter.RulesRecord = RulesConfig> = Omit<Linter.LegacyConfig<Rules>, "$schema">;
2536
+ type Environment = EnvironmentConfig;
2537
+ type ObjectMetaProperties = ObjectMetaProperties;
2538
+ type Plugin = Plugin$1;
2539
+ type FixType = "directive" | "problem" | "suggestion" | "layout";
2540
+ type CacheStrategy = "content" | "metadata";
2541
+ interface Options {
2542
+ // File enumeration
2543
+ cwd?: string | undefined;
2544
+ errorOnUnmatchedPattern?: boolean | undefined;
2545
+ globInputPaths?: boolean | undefined;
2546
+ ignore?: boolean | undefined;
2547
+ ignorePatterns?: string[] | null | undefined;
2548
+ passOnNoPatterns?: boolean | undefined;
2549
+ warnIgnored?: boolean | undefined; // Linting
2550
+ allowInlineConfig?: boolean | undefined;
2551
+ baseConfig?: Linter.Config | Linter.Config[] | null | undefined;
2552
+ overrideConfig?: Linter.Config | Linter.Config[] | null | undefined;
2553
+ overrideConfigFile?: string | true | null | undefined;
2554
+ plugins?: Record<string, Plugin> | null | undefined;
2555
+ ruleFilter?: ((arg: {
2556
+ ruleId: string;
2557
+ severity: Exclude<Linter.Severity, 0>;
2558
+ }) => boolean) | undefined;
2559
+ stats?: boolean | undefined; // Autofix
2560
+ fix?: boolean | ((message: Linter.LintMessage) => boolean) | undefined;
2561
+ fixTypes?: FixType[] | null | undefined; // Cache-related
2562
+ cache?: boolean | undefined;
2563
+ cacheLocation?: string | undefined;
2564
+ cacheStrategy?: CacheStrategy | undefined; // Other Options
2565
+ concurrency?: number | "auto" | "off" | undefined;
2566
+ flags?: string[] | undefined;
2567
+ }
2568
+ /** A linting result. */
2569
+ interface LintResult {
2570
+ /** The path to the file that was linted. */
2571
+ filePath: string;
2572
+ /** All of the messages for the result. */
2573
+ messages: Linter.LintMessage[];
2574
+ /** All of the suppressed messages for the result. */
2575
+ suppressedMessages: Linter.SuppressedLintMessage[];
2576
+ /** Number of errors for the result. */
2577
+ errorCount: number;
2578
+ /** Number of fatal errors for the result. */
2579
+ fatalErrorCount: number;
2580
+ /** Number of warnings for the result. */
2581
+ warningCount: number;
2582
+ /** Number of fixable errors for the result. */
2583
+ fixableErrorCount: number;
2584
+ /** Number of fixable warnings for the result. */
2585
+ fixableWarningCount: number;
2586
+ /** The source code of the file that was linted, with as many fixes applied as possible. */
2587
+ output?: string | undefined;
2588
+ /** The source code of the file that was linted. */
2589
+ source?: string | undefined;
2590
+ /** The performance statistics collected with the `stats` flag. */
2591
+ stats?: Linter.Stats | undefined;
2592
+ /** The list of used deprecated rules. */
2593
+ usedDeprecatedRules: DeprecatedRuleUse[];
2594
+ }
2595
+ /**
2596
+ * Information provided when the maximum warning threshold is exceeded.
2597
+ */
2598
+ interface MaxWarningsExceeded {
19
2599
  /**
20
- * Enable TailwindCSS support
21
- * @default false
2600
+ * Number of warnings to trigger nonzero exit code.
22
2601
  */
23
- tailwindcss?: TailwindcssConfig;
2602
+ maxWarnings: number;
24
2603
  /**
25
- * Enable MDX support
26
- * @default false
2604
+ * Number of warnings found while linting.
27
2605
  */
28
- mdx?: boolean;
2606
+ foundWarnings: number;
2607
+ }
2608
+ interface LintResultData extends ResultsMeta {
2609
+ cwd: string;
2610
+ rulesMeta: {
2611
+ [ruleId: string]: Rule.RuleMetaData;
2612
+ };
2613
+ }
2614
+ /**
2615
+ * Information about deprecated rules.
2616
+ */
2617
+ interface DeprecatedRuleUse {
29
2618
  /**
30
- * Enable A11y support
31
- * @default false
2619
+ * The rule ID.
32
2620
  */
33
- a11y?: boolean;
2621
+ ruleId: string;
34
2622
  /**
35
- * Enable NestJS support
36
- * @default false
2623
+ * The rule IDs that replace this deprecated rule.
37
2624
  */
38
- nestjs?: boolean;
2625
+ replacedBy: string[];
39
2626
  /**
40
- * Enable TanStack Query support
41
- * @default false
2627
+ * The raw deprecated info provided by the rule.
2628
+ * - Undefined if the rule's `meta.deprecated` property is a boolean.
2629
+ * - Unset when using the legacy eslintrc configuration.
42
2630
  */
43
- query?: boolean;
2631
+ info?: DeprecatedInfo | undefined;
2632
+ }
2633
+ /**
2634
+ * Metadata about results for formatters.
2635
+ */
2636
+ interface ResultsMeta {
44
2637
  /**
45
- * Enable Ionic support
46
- * @default false
2638
+ * Whether or not to use color in the formatter output.
2639
+ * - If `--color` was set, this property is `true`.
2640
+ * - If `--no-color` was set, it is `false`.
2641
+ * - If neither option was provided, the property is omitted.
47
2642
  */
48
- ionic?: boolean;
2643
+ color?: boolean | undefined;
49
2644
  /**
50
- * Enable Weapp support
51
- * @default false
2645
+ * Present if the maxWarnings threshold was exceeded.
2646
+ */
2647
+ maxWarningsExceeded?: MaxWarningsExceeded | undefined;
2648
+ }
2649
+ /** The type of an object resolved by {@link ESLint.loadFormatter}. */
2650
+ interface LoadedFormatter {
2651
+ /**
2652
+ * Used to call the underlying formatter.
2653
+ * @param results An array of lint results to format.
2654
+ * @param resultsMeta An object with optional `color` and `maxWarningsExceeded` properties that will be
2655
+ * passed to the underlying formatter function along with other properties set by ESLint.
2656
+ * This argument can be omitted if `color` and `maxWarningsExceeded` are not needed.
2657
+ * @return The formatter output.
52
2658
  */
53
- weapp?: boolean;
2659
+ format(results: LintResult[], resultsMeta?: ResultsMeta): string | Promise<string>;
2660
+ } // The documented type name is `LoadedFormatter`, but `Formatter` has been historically more used.
2661
+ type Formatter = LoadedFormatter;
2662
+ /**
2663
+ * The expected signature of a custom formatter.
2664
+ * @param results An array of lint results to format.
2665
+ * @param context Additional information for the formatter.
2666
+ * @return The formatter output.
2667
+ */
2668
+ type FormatterFunction = (results: LintResult[], context: LintResultData) => string | Promise<string>; // Docs reference the types by those name
2669
+ type EditInfo = Rule.Fix;
2670
+ }
2671
+ //#endregion
2672
+ //#region ../../node_modules/.pnpm/eslint-flat-config-utils@3.0.2/node_modules/eslint-flat-config-utils/dist/index.d.mts
2673
+ /**
2674
+ * A type that can be awaited. Promise<T> or T.
2675
+ */
2676
+ type Awaitable$1<T> = T | Promise<T>;
2677
+ /**
2678
+ * A type that can be an array or a single item.
2679
+ */
2680
+ type Arrayable<T> = T | T[];
2681
+ /**
2682
+ * Default config names map. Used for type augmentation.
2683
+ *
2684
+ * @example
2685
+ * ```ts
2686
+ * declare module 'eslint-flat-config-utils' {
2687
+ * interface DefaultConfigNamesMap {
2688
+ * 'my-custom-config': true
2689
+ * }
2690
+ * }
2691
+ * ```
2692
+ */
2693
+ interface DefaultConfigNamesMap {}
2694
+ interface Nothing {}
2695
+ /**
2696
+ * type StringLiteralUnion<'foo'> = 'foo' | string
2697
+ * This has auto completion whereas `'foo' | string` doesn't
2698
+ * Adapted from https://github.com/microsoft/TypeScript/issues/29729
2699
+ */
2700
+ type StringLiteralUnion<T extends U, U = string> = T | (U & Nothing);
2701
+ type FilterType<T, F> = T extends F ? T : never;
2702
+ type NullableObject<T> = { [K in keyof T]?: T[K] | null | undefined };
2703
+ type GetRuleRecordFromConfig<T> = T extends {
2704
+ rules?: infer R;
2705
+ } ? R : Linter.RulesRecord;
2706
+ interface DisableFixesOptions {
2707
+ builtinRules?: Map<string, Rule.RuleModule> | (() => Awaitable$1<Map<string, Rule.RuleModule>>);
2708
+ }
2709
+ type PluginConflictsError<T extends Linter.Config = Linter.Config> = (pluginName: string, configs: T[]) => string;
2710
+ /**
2711
+ * Awaitable array of ESLint flat configs or a composer object.
2712
+ */
2713
+ type ResolvableFlatConfig<T extends object = ConfigWithExtends> = Awaitable$1<Arrayable<(T | false | undefined | null)>> | Awaitable$1<(ConfigWithExtends | false | undefined | null)[]> | Awaitable$1<(Linter.Config | false | undefined | null)[]> | FlatConfigComposer<any>;
2714
+ /**
2715
+ * Create a chainable composer object that makes manipulating ESLint flat config easier.
2716
+ *
2717
+ * It extends Promise, so that you can directly await or export it to `eslint.config.mjs`
2718
+ *
2719
+ * ```ts
2720
+ * // eslint.config.mjs
2721
+ * import { composer } from 'eslint-flat-config-utils'
2722
+ *
2723
+ * export default composer(
2724
+ * {
2725
+ * plugins: {},
2726
+ * rules: {},
2727
+ * }
2728
+ * // ...some configs, accepts same arguments as `concat`
2729
+ * )
2730
+ * .append(
2731
+ * // appends more configs at the end, accepts same arguments as `concat`
2732
+ * )
2733
+ * .prepend(
2734
+ * // prepends more configs at the beginning, accepts same arguments as `concat`
2735
+ * )
2736
+ * .insertAfter(
2737
+ * 'config-name', // specify the name of the target config, or index
2738
+ * // insert more configs after the target, accepts same arguments as `concat`
2739
+ * )
2740
+ * .renamePlugins({
2741
+ * // rename plugins
2742
+ * 'old-name': 'new-name',
2743
+ * // for example, rename `n` from `eslint-plugin-n` to more a explicit prefix `node`
2744
+ * 'n': 'node'
2745
+ * // applies to all plugins and rules in the configs
2746
+ * })
2747
+ * .override(
2748
+ * 'config-name', // specify the name of the target config, or index
2749
+ * {
2750
+ * // merge with the target config
2751
+ * rules: {
2752
+ * 'no-console': 'off'
2753
+ * },
2754
+ * }
2755
+ * )
2756
+ *
2757
+ * // And you an directly return the composer object to `eslint.config.mjs`
2758
+ * ```
2759
+ */
2760
+ /**
2761
+ * The underlying impolementation of `composer()`.
2762
+ */
2763
+ declare class FlatConfigComposer<T extends object = ConfigWithExtends, ConfigNames extends string = keyof DefaultConfigNamesMap> extends Promise<Linter.Config[]> {
2764
+ private _operations;
2765
+ private _operationsOverrides;
2766
+ private _operationsResolved;
2767
+ private _renames;
2768
+ private _pluginsConflictsError;
2769
+ constructor(...configs: ResolvableFlatConfig<T>[]);
2770
+ /**
2771
+ * Set plugin renames, like `n` -> `node`, `import-x` -> `import`, etc.
2772
+ *
2773
+ * This will runs after all config items are resolved. Applies to `plugins` and `rules`.
2774
+ */
2775
+ renamePlugins(renames: Record<string, string>): this;
2776
+ /**
2777
+ * Append configs to the end of the current configs array.
2778
+ */
2779
+ append(...items: ResolvableFlatConfig<T>[]): this;
2780
+ /**
2781
+ * Prepend configs to the beginning of the current configs array.
2782
+ */
2783
+ prepend(...items: ResolvableFlatConfig<T>[]): this;
2784
+ /**
2785
+ * Insert configs before a specific config.
2786
+ */
2787
+ insertBefore(nameOrIndex: StringLiteralUnion<ConfigNames, string | number>, ...items: ResolvableFlatConfig<T>[]): this;
2788
+ /**
2789
+ * Insert configs after a specific config.
2790
+ */
2791
+ insertAfter(nameOrIndex: StringLiteralUnion<ConfigNames, string | number>, ...items: ResolvableFlatConfig<T>[]): this;
2792
+ /**
2793
+ * Provide overrides to a specific config.
2794
+ *
2795
+ * It will be merged with the original config, or provide a custom function to replace the config entirely.
2796
+ */
2797
+ override(nameOrIndex: StringLiteralUnion<ConfigNames, string | number>, config: T | ((config: T) => Awaitable$1<T>)): this;
2798
+ /**
2799
+ * Provide overrides to multiple configs as an object map.
2800
+ *
2801
+ * Same as calling `override` multiple times.
2802
+ */
2803
+ overrides(overrides: Partial<Record<StringLiteralUnion<ConfigNames, string | number>, T | ((config: T) => Awaitable$1<T>)>>): this;
2804
+ /**
2805
+ * Override rules and it's options in **all configs**.
2806
+ *
2807
+ * Pass `null` as the value to remove the rule.
2808
+ *
2809
+ * @example
2810
+ * ```ts
2811
+ * composer
2812
+ * .overrideRules({
2813
+ * 'no-console': 'off',
2814
+ * 'no-unused-vars': ['error', { vars: 'all', args: 'after-used' }],
2815
+ * // remove the rule from all configs
2816
+ * 'no-undef': null,
2817
+ * })
2818
+ * ```
2819
+ */
2820
+ overrideRules(rules: NullableObject<GetRuleRecordFromConfig<T>>): this;
2821
+ /**
2822
+ * Remove rules from **all configs**.
2823
+ *
2824
+ * @example
2825
+ * ```ts
2826
+ * composer
2827
+ * .removeRules(
2828
+ * 'no-console',
2829
+ * 'no-unused-vars'
2830
+ * )
2831
+ * ```
2832
+ */
2833
+ removeRules(...rules: StringLiteralUnion<FilterType<keyof GetRuleRecordFromConfig<T>, string>, string>[]): this;
2834
+ /**
2835
+ * Remove plugins by name and all the rules referenced by them.
2836
+ *
2837
+ * @example
2838
+ * ```ts
2839
+ * composer
2840
+ * .removePlugins(
2841
+ * 'node'
2842
+ * )
2843
+ * ```
2844
+ *
2845
+ * The `plugins: { node }` and `rules: { 'node/xxx': 'error' }` will be removed from all configs.
2846
+ */
2847
+ removePlugins(...names: string[]): this;
2848
+ /**
2849
+ * Remove a specific config by name or index.
2850
+ */
2851
+ remove(nameOrIndex: ConfigNames | string | number): this;
2852
+ /**
2853
+ * Replace a specific config by name or index.
2854
+ *
2855
+ * The original config will be removed and replaced with the new one.
2856
+ */
2857
+ replace(nameOrIndex: StringLiteralUnion<ConfigNames, string | number>, ...items: ResolvableFlatConfig<T>[]): this;
2858
+ /**
2859
+ * Hijack into plugins to disable fixes for specific rules.
2860
+ *
2861
+ * Note this mutates the plugin object, use with caution.
2862
+ *
2863
+ * @example
2864
+ * ```ts
2865
+ * const config = await composer(...)
2866
+ * .disableRulesFix([
2867
+ * 'unused-imports/no-unused-imports',
2868
+ * 'vitest/no-only-tests'
2869
+ * ])
2870
+ * ```
2871
+ */
2872
+ disableRulesFix(ruleIds: string[], options?: DisableFixesOptions): this;
2873
+ /**
2874
+ * Set a custom warning message for plugins conflicts.
2875
+ *
2876
+ * The error message can be a string or a function that returns a string.
2877
+ *
2878
+ * Error message accepts template strings:
2879
+ * - `{{pluginName}}`: the name of the plugin that has conflicts
2880
+ * - `{{configName1}}`: the name of the first config that uses the plugin
2881
+ * - `{{configName2}}`: the name of the second config that uses the plugin
2882
+ * - `{{configNames}}`: a list of config names that uses the plugin
2883
+ *
2884
+ * When only one argument is provided, it will be used as the default error message.
2885
+ */
2886
+ setPluginConflictsError(warning?: string | PluginConflictsError): this;
2887
+ setPluginConflictsError(pluginName: string, warning: string | PluginConflictsError): this;
2888
+ private _verifyPluginsConflicts;
2889
+ /**
2890
+ * Hook when all configs are resolved but before returning the final configs.
2891
+ *
2892
+ * You can modify the final configs here.
2893
+ */
2894
+ onResolved(callback: (configs: T[]) => Awaitable$1<T[] | void>): this;
2895
+ /**
2896
+ * Clone the composer object.
2897
+ */
2898
+ clone(): FlatConfigComposer<T>;
2899
+ /**
2900
+ * Resolve the pipeline and return the final configs.
2901
+ *
2902
+ * This returns a promise. Calling `.then()` has the same effect.
2903
+ */
2904
+ toConfigs(): Promise<Linter.Config[]>;
2905
+ then<T>(onFulfilled: (value: Linter.Config[]) => T, onRejected?: (reason: any) => any): Promise<Awaited<T>>;
2906
+ catch(onRejected: (reason: any) => any): Promise<any>;
2907
+ finally(onFinally: () => void): Promise<Linter.Config[]>;
2908
+ }
2909
+ /**
2910
+ * @deprecated Renamed to `composer`.
2911
+ */
2912
+ //#endregion
2913
+ //#region src/types.d.ts
2914
+ interface TailwindcssOption {
2915
+ /**
2916
+ * Tailwind CSS v4 entry point, e.g. `src/global.css`.
2917
+ */
2918
+ entryPoint?: string;
2919
+ /**
2920
+ * Tailwind CSS v3 config file path, e.g. `tailwind.config.js`.
2921
+ */
2922
+ tailwindConfig?: string;
2923
+ }
2924
+ type TailwindcssConfig = boolean | TailwindcssOption;
2925
+ type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem$1 & {
2926
+ /**
2927
+ * Enable TailwindCSS support
2928
+ * @default false
2929
+ */
2930
+ tailwindcss?: TailwindcssConfig;
2931
+ /**
2932
+ * Enable MDX support
2933
+ * @default false
2934
+ */
2935
+ mdx?: boolean;
2936
+ /**
2937
+ * Enable A11y support
2938
+ * @default false
2939
+ */
2940
+ a11y?: boolean;
2941
+ /**
2942
+ * Enable NestJS support
2943
+ * @default false
2944
+ */
2945
+ nestjs?: boolean;
2946
+ /**
2947
+ * Enable TanStack Query support
2948
+ * @default false
2949
+ */
2950
+ query?: boolean;
2951
+ /**
2952
+ * Enable Ionic support
2953
+ * @default false
2954
+ */
2955
+ ionic?: boolean;
2956
+ /**
2957
+ * Enable Weapp support
2958
+ * @default false
2959
+ */
2960
+ weapp?: boolean;
54
2961
  };
55
- type UserConfigItem = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>;
56
-
2962
+ type UserConfigItem = Awaitable<TypedFlatConfigItem$1 | TypedFlatConfigItem$1[] | FlatConfigComposer<any, any> | Linter.Config[]>;
2963
+ //#endregion
2964
+ //#region src/factory.d.ts
57
2965
  declare function icebreaker(options?: UserDefinedOptions, ...userConfigs: UserConfigItem[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
58
2966
  declare function icebreakerLegacy(options?: UserDefinedOptions, ...userConfigs: UserConfigItem[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
59
-
2967
+ //#endregion
2968
+ //#region src/preset.d.ts
60
2969
  declare function getPresets(options?: UserDefinedOptions, mode?: 'legacy'): [UserDefinedOptions, ...UserConfigItem[]];
61
-
62
- export { type TailwindcssConfig, type TailwindcssOption, type UserConfigItem, type UserDefinedOptions, getPresets, icebreaker, icebreakerLegacy };
2970
+ //#endregion
2971
+ export { type ConfigNames, type FlatConfigComposer, type TailwindcssConfig, type TailwindcssOption, type TypedFlatConfigItem, type UserConfigItem, type UserDefinedOptions, getPresets, icebreaker, icebreakerLegacy };