eslint-cli-bundle 2.0.0 → 3.0.0

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.
@@ -0,0 +1,1732 @@
1
+ //#endregion
2
+ //#region node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
3
+ // ==================================================================================================
4
+ // JSON Schema Draft 04
5
+ // ==================================================================================================
6
+ /**
7
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
8
+ */
9
+ type JSONSchema4TypeName = "string" //
10
+ | "number" | "integer" | "boolean" | "object" | "array" | "null" | "any";
11
+ /**
12
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
13
+ */
14
+ type JSONSchema4Type = string //
15
+ | number | boolean | JSONSchema4Object | JSONSchema4Array | null;
16
+ // Workaround for infinite type recursion
17
+ interface JSONSchema4Object {
18
+ [key: string]: JSONSchema4Type;
19
+ }
20
+ // Workaround for infinite type recursion
21
+ // https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
22
+ interface JSONSchema4Array extends Array<JSONSchema4Type> {}
23
+ /**
24
+ * Meta schema
25
+ *
26
+ * Recommended values:
27
+ * - 'http://json-schema.org/schema#'
28
+ * - 'http://json-schema.org/hyper-schema#'
29
+ * - 'http://json-schema.org/draft-04/schema#'
30
+ * - 'http://json-schema.org/draft-04/hyper-schema#'
31
+ * - 'http://json-schema.org/draft-03/schema#'
32
+ * - 'http://json-schema.org/draft-03/hyper-schema#'
33
+ *
34
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
35
+ */
36
+ type JSONSchema4Version = string;
37
+ /**
38
+ * JSON Schema V4
39
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04
40
+ */
41
+ interface JSONSchema4 {
42
+ id?: string | undefined;
43
+ $ref?: string | undefined;
44
+ $schema?: JSONSchema4Version | undefined;
45
+ /**
46
+ * This attribute is a string that provides a short description of the
47
+ * instance property.
48
+ *
49
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
50
+ */
51
+ title?: string | undefined;
52
+ /**
53
+ * This attribute is a string that provides a full description of the of
54
+ * purpose the instance property.
55
+ *
56
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
57
+ */
58
+ description?: string | undefined;
59
+ default?: JSONSchema4Type | undefined;
60
+ multipleOf?: number | undefined;
61
+ maximum?: number | undefined;
62
+ exclusiveMaximum?: boolean | undefined;
63
+ minimum?: number | undefined;
64
+ exclusiveMinimum?: boolean | undefined;
65
+ maxLength?: number | undefined;
66
+ minLength?: number | undefined;
67
+ pattern?: string | undefined;
68
+ /**
69
+ * May only be defined when "items" is defined, and is a tuple of JSONSchemas.
70
+ *
71
+ * This provides a definition for additional items in an array instance
72
+ * when tuple definitions of the items is provided. This can be false
73
+ * to indicate additional items in the array are not allowed, or it can
74
+ * be a schema that defines the schema of the additional items.
75
+ *
76
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
77
+ */
78
+ additionalItems?: boolean | JSONSchema4 | undefined;
79
+ /**
80
+ * This attribute defines the allowed items in an instance array, and
81
+ * MUST be a schema or an array of schemas. The default value is an
82
+ * empty schema which allows any value for items in the instance array.
83
+ *
84
+ * When this attribute value is a schema and the instance value is an
85
+ * array, then all the items in the array MUST be valid according to the
86
+ * schema.
87
+ *
88
+ * When this attribute value is an array of schemas and the instance
89
+ * value is an array, each position in the instance array MUST conform
90
+ * to the schema in the corresponding position for this array. This
91
+ * called tuple typing. When tuple typing is used, additional items are
92
+ * allowed, disallowed, or constrained by the "additionalItems"
93
+ * (Section 5.6) attribute using the same rules as
94
+ * "additionalProperties" (Section 5.4) for objects.
95
+ *
96
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
97
+ */
98
+ items?: JSONSchema4 | JSONSchema4[] | undefined;
99
+ maxItems?: number | undefined;
100
+ minItems?: number | undefined;
101
+ uniqueItems?: boolean | undefined;
102
+ maxProperties?: number | undefined;
103
+ minProperties?: number | undefined;
104
+ /**
105
+ * This attribute indicates if the instance must have a value, and not
106
+ * be undefined. This is false by default, making the instance
107
+ * optional.
108
+ *
109
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
110
+ */
111
+ required?: boolean | string[] | undefined;
112
+ /**
113
+ * This attribute defines a schema for all properties that are not
114
+ * explicitly defined in an object type definition. If specified, the
115
+ * value MUST be a schema or a boolean. If false is provided, no
116
+ * additional properties are allowed beyond the properties defined in
117
+ * the schema. The default value is an empty schema which allows any
118
+ * value for additional properties.
119
+ *
120
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
121
+ */
122
+ additionalProperties?: boolean | JSONSchema4 | undefined;
123
+ definitions?: {
124
+ [k: string]: JSONSchema4;
125
+ } | undefined;
126
+ /**
127
+ * This attribute is an object with property definitions that define the
128
+ * valid values of instance object property values. When the instance
129
+ * value is an object, the property values of the instance object MUST
130
+ * conform to the property definitions in this object. In this object,
131
+ * each property definition's value MUST be a schema, and the property's
132
+ * name MUST be the name of the instance property that it defines. The
133
+ * instance property value MUST be valid according to the schema from
134
+ * the property definition. Properties are considered unordered, the
135
+ * order of the instance properties MAY be in any order.
136
+ *
137
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
138
+ */
139
+ properties?: {
140
+ [k: string]: JSONSchema4;
141
+ } | undefined;
142
+ /**
143
+ * This attribute is an object that defines the schema for a set of
144
+ * property names of an object instance. The name of each property of
145
+ * this attribute's object is a regular expression pattern in the ECMA
146
+ * 262/Perl 5 format, while the value is a schema. If the pattern
147
+ * matches the name of a property on the instance object, the value of
148
+ * the instance's property MUST be valid against the pattern name's
149
+ * schema value.
150
+ *
151
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3
152
+ */
153
+ patternProperties?: {
154
+ [k: string]: JSONSchema4;
155
+ } | undefined;
156
+ dependencies?: {
157
+ [k: string]: JSONSchema4 | string[];
158
+ } | undefined;
159
+ /**
160
+ * This provides an enumeration of all possible values that are valid
161
+ * for the instance property. This MUST be an array, and each item in
162
+ * the array represents a possible value for the instance value. If
163
+ * this attribute is defined, the instance value MUST be one of the
164
+ * values in the array in order for the schema to be valid.
165
+ *
166
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
167
+ */
168
+ enum?: JSONSchema4Type[] | undefined;
169
+ /**
170
+ * A single type, or a union of simple types
171
+ */
172
+ type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;
173
+ allOf?: JSONSchema4[] | undefined;
174
+ anyOf?: JSONSchema4[] | undefined;
175
+ oneOf?: JSONSchema4[] | undefined;
176
+ not?: JSONSchema4 | undefined;
177
+ /**
178
+ * The value of this property MUST be another schema which will provide
179
+ * a base schema which the current schema will inherit from. The
180
+ * inheritance rules are such that any instance that is valid according
181
+ * to the current schema MUST be valid according to the referenced
182
+ * schema. This MAY also be an array, in which case, the instance MUST
183
+ * be valid for all the schemas in the array. A schema that extends
184
+ * another schema MAY define additional attributes, constrain existing
185
+ * attributes, or add other constraints.
186
+ *
187
+ * Conceptually, the behavior of extends can be seen as validating an
188
+ * instance against all constraints in the extending schema as well as
189
+ * the extended schema(s).
190
+ *
191
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
192
+ */
193
+ extends?: string | string[] | undefined;
194
+ /**
195
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6
196
+ */
197
+ [k: string]: any;
198
+ format?: string | undefined;
199
+ }
200
+ declare namespace types_d_exports$1 {
201
+ export { BaseConfig, BinarySourceCode, CallTraversalStep$1 as CallTraversalStep, ConfigObject, ConfigOverride, CustomRuleDefinitionType$2 as CustomRuleDefinitionType, CustomRuleTypeDefinitions$2 as CustomRuleTypeDefinitions, DeprecatedInfo, Directive$1 as Directive, DirectiveType$1 as DirectiveType, EcmaVersion, EnvironmentConfig, ExternalSpecifier, File, FileError, FileProblem, GlobalAccess, GlobalsConfig, HasRules, JavaScriptParserOptionsConfig, JavaScriptSourceType, Language, LanguageContext, LanguageOptions, LanguageTypeOptions, LegacyConfigObject, LintMessage, LintSuggestion, LinterOptionsConfig, MessagePlaceholderData, NotOkParseResult, ObjectMetaProperties, OkParseResult, ParseResult, Plugin, Position, PositionWithOffset, Processor, ProcessorFile, ReplacedByInfo, RuleConfig$1 as RuleConfig, RuleContext, RuleContextTypeOptions, RuleDefinition, RuleDefinitionTypeOptions, RuleFixType, RuleFixer, RuleTextEdit, RuleTextEditor, RuleType, RuleVisitor$1 as RuleVisitor, RulesConfig$1 as RulesConfig, RulesMeta, RulesMetaDocs, SettingsConfig, Severity, SeverityLevel, SeverityName, SourceCode, SourceCodeBaseTypeOptions$1 as SourceCodeBaseTypeOptions, SourceLocation$1 as SourceLocation, SourceLocationWithOffset$1 as SourceLocationWithOffset, SourceRange$1 as SourceRange, SuggestedEdit, SuggestedEditBase, SuggestionMessage, TextSourceCode$1 as TextSourceCode, TraversalStep$1 as TraversalStep, ViolationLocation, ViolationMessage, ViolationReport, ViolationReportBase, VisitTraversalStep$1 as VisitTraversalStep };
202
+ }
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$1;
220
+ }
221
+ /**
222
+ * Represents the start and end coordinates of a node inside the source.
223
+ */
224
+ interface SourceLocation$1 {
225
+ start: Position;
226
+ end: Position;
227
+ }
228
+ /**
229
+ * Represents the start and end coordinates of a node inside the source with an offset.
230
+ */
231
+ interface SourceLocationWithOffset$1 {
232
+ start: PositionWithOffset;
233
+ end: PositionWithOffset;
234
+ }
235
+ /**
236
+ * Represents a location coordinate inside the source. ESLint-style formats
237
+ * have just `line` and `column` while others may have `offset` as well.
238
+ */
239
+ interface Position {
240
+ line: number;
241
+ column: number;
242
+ }
243
+ /**
244
+ * Represents a location coordinate inside the source with an offset.
245
+ */
246
+ interface PositionWithOffset extends Position {
247
+ offset: number;
248
+ }
249
+ /**
250
+ * Represents a range of characters in the source.
251
+ */
252
+ type SourceRange$1 = [number, number];
253
+ /**
254
+ * What the rule is responsible for finding:
255
+ * - `problem` means the rule has noticed a potential error.
256
+ * - `suggestion` means the rule suggests an alternate or better approach.
257
+ * - `layout` means the rule is looking at spacing, indentation, etc.
258
+ */
259
+ type RuleType = "problem" | "suggestion" | "layout";
260
+ /**
261
+ * The type of fix the rule can provide:
262
+ * - `code` means the rule can fix syntax.
263
+ * - `whitespace` means the rule can fix spacing and indentation.
264
+ */
265
+ type RuleFixType = "code" | "whitespace";
266
+ /**
267
+ * An object containing visitor information for a rule. Each method is either the
268
+ * name of a node type or a selector, or is a method that will be called at specific
269
+ * times during the traversal.
270
+ */
271
+ type RuleVisitor$1 = Record<string, ((...args: any[]) => void) | undefined>;
272
+ /**
273
+ * Rule meta information used for documentation.
274
+ */
275
+ interface RulesMetaDocs {
276
+ /**
277
+ * A short description of the rule.
278
+ */
279
+ description?: string | undefined;
280
+ /**
281
+ * The URL to the documentation for the rule.
282
+ */
283
+ url?: string | undefined;
284
+ /**
285
+ * Indicates if the rule is generally recommended for all users.
286
+ *
287
+ * Note - this will always be a boolean for core rules, but may be used in any way by plugins.
288
+ */
289
+ recommended?: unknown;
290
+ /**
291
+ * Indicates if the rule is frozen (no longer accepting feature requests).
292
+ */
293
+ frozen?: boolean | undefined;
294
+ /**
295
+ * The dialects of the languages that the rule is intended to lint.
296
+ * @example
297
+ * ["JavaScript", "TypeScript"]
298
+ */
299
+ dialects?: string[] | undefined;
300
+ }
301
+ /**
302
+ * Meta information about a rule.
303
+ */
304
+ interface RulesMeta<MessageIds extends string = string, RuleOptions = unknown[], ExtRuleDocs = unknown> {
305
+ /**
306
+ * Properties that are used when documenting the rule.
307
+ */
308
+ docs?: (RulesMetaDocs & ExtRuleDocs) | undefined;
309
+ /**
310
+ * The type of rule.
311
+ */
312
+ type?: RuleType | undefined;
313
+ /**
314
+ * The schema for the rule options. Required if the rule has options.
315
+ */
316
+ schema?: JSONSchema4 | JSONSchema4[] | false | undefined;
317
+ /**
318
+ * Any default options to be recursively merged on top of any user-provided options.
319
+ */
320
+ defaultOptions?: RuleOptions;
321
+ /**
322
+ * The messages that the rule can report.
323
+ */
324
+ messages?: Record<MessageIds, string>;
325
+ /**
326
+ * Indicates whether the rule has been deprecated or provides additional metadata about the deprecation. Omit if not deprecated.
327
+ */
328
+ deprecated?: boolean | DeprecatedInfo | undefined;
329
+ /**
330
+ * @deprecated Use deprecated.replacedBy instead.
331
+ * The name of the rule(s) this rule was replaced by, if it was deprecated.
332
+ */
333
+ replacedBy?: readonly string[] | undefined;
334
+ /**
335
+ * Indicates if the rule is fixable, and if so, what type of fix it provides.
336
+ */
337
+ fixable?: RuleFixType | undefined;
338
+ /**
339
+ * Indicates if the rule may provide suggestions.
340
+ */
341
+ hasSuggestions?: boolean | undefined;
342
+ /**
343
+ * The language the rule is intended to lint.
344
+ * @deprecated Use `languages` instead.
345
+ */
346
+ language?: string;
347
+ /**
348
+ * The dialects of `language` that the rule is intended to lint.
349
+ * @deprecated Use `docs.dialects` instead.
350
+ */
351
+ dialects?: string[];
352
+ /**
353
+ * Languages supported by this rule in the format `"plugin/language"`.
354
+ * Use `"*"` for any language or `"plugin/*"` for any language from a specific plugin.
355
+ * @example
356
+ * ["js/js", "markdown/gfm", "json/jsonc", "css/css"]
357
+ */
358
+ languages?: string[] | undefined;
359
+ }
360
+ /**
361
+ * Provides additional metadata about a deprecation.
362
+ */
363
+ interface DeprecatedInfo {
364
+ /**
365
+ * General message presented to the user, e.g. for the key rule why the rule
366
+ * is deprecated or for info how to replace the rule.
367
+ */
368
+ message?: string;
369
+ /**
370
+ * URL to more information about this deprecation in general.
371
+ */
372
+ url?: string;
373
+ /**
374
+ * An empty array explicitly states that there is no replacement.
375
+ */
376
+ replacedBy?: ReplacedByInfo[];
377
+ /**
378
+ * The package version since when the rule is deprecated (should use full
379
+ * semver without a leading "v").
380
+ */
381
+ deprecatedSince?: string;
382
+ /**
383
+ * The estimated version when the rule is removed (probably the next major
384
+ * version). null means the rule is "frozen" (will be available but will not
385
+ * be changed).
386
+ */
387
+ availableUntil?: string | null;
388
+ }
389
+ /**
390
+ * Provides metadata about a replacement
391
+ */
392
+ interface ReplacedByInfo {
393
+ /**
394
+ * General message presented to the user, e.g. how to replace the rule
395
+ */
396
+ message?: string;
397
+ /**
398
+ * URL to more information about this replacement in general
399
+ */
400
+ url?: string;
401
+ /**
402
+ * Name should be "eslint" if the replacement is an ESLint core rule. Omit
403
+ * the property if the replacement is in the same plugin.
404
+ */
405
+ plugin?: ExternalSpecifier;
406
+ /**
407
+ * Name and documentation of the replacement rule
408
+ */
409
+ rule?: ExternalSpecifier;
410
+ }
411
+ /**
412
+ * Specifies the name and url of an external resource. At least one property
413
+ * should be set.
414
+ */
415
+ interface ExternalSpecifier {
416
+ /**
417
+ * Name of the referenced plugin / rule.
418
+ */
419
+ name?: string;
420
+ /**
421
+ * URL pointing to documentation for the plugin / rule.
422
+ */
423
+ url?: string;
424
+ }
425
+ /**
426
+ * Generic type for `RuleContext`.
427
+ */
428
+ interface RuleContextTypeOptions {
429
+ LangOptions: LanguageOptions;
430
+ Code: SourceCode;
431
+ RuleOptions: unknown[];
432
+ Node: unknown;
433
+ MessageIds: string;
434
+ }
435
+ /**
436
+ * Represents the context object that is passed to a rule. This object contains
437
+ * information about the current state of the linting process and is the rule's
438
+ * view into the outside world.
439
+ */
440
+ interface RuleContext<Options extends RuleContextTypeOptions = RuleContextTypeOptions> {
441
+ /**
442
+ * The current working directory for the session.
443
+ */
444
+ cwd: string;
445
+ /**
446
+ * The filename of the file being linted.
447
+ */
448
+ filename: string;
449
+ /**
450
+ * The physical filename of the file being linted.
451
+ */
452
+ physicalFilename: string;
453
+ /**
454
+ * The source code object that the rule is running on.
455
+ */
456
+ sourceCode: Options["Code"];
457
+ /**
458
+ * Shared settings for the configuration.
459
+ */
460
+ settings: SettingsConfig;
461
+ /**
462
+ * The language options for the configuration.
463
+ */
464
+ languageOptions: Options["LangOptions"];
465
+ /**
466
+ * The rule ID.
467
+ */
468
+ id: string;
469
+ /**
470
+ * The rule's configured options.
471
+ */
472
+ options: Options["RuleOptions"];
473
+ /**
474
+ * The report function that the rule should use to report problems.
475
+ * @param violation The violation to report.
476
+ */
477
+ report(violation: ViolationReport<Options["Node"], Options["MessageIds"]>): void;
478
+ }
479
+ /**
480
+ * Manager of text edits for a rule fix.
481
+ */
482
+ interface RuleTextEditor<EditableSyntaxElement = unknown> {
483
+ /**
484
+ * Inserts text after the specified node or token.
485
+ * @param syntaxElement The node or token to insert after.
486
+ * @param text The edit to insert after the node or token.
487
+ */
488
+ insertTextAfter(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
489
+ /**
490
+ * Inserts text after the specified range.
491
+ * @param range The range to insert after.
492
+ * @param text The edit to insert after the range.
493
+ */
494
+ insertTextAfterRange(range: SourceRange$1, text: string): RuleTextEdit;
495
+ /**
496
+ * Inserts text before the specified node or token.
497
+ * @param syntaxElement A syntax element with location information to insert before.
498
+ * @param text The edit to insert before the node or token.
499
+ */
500
+ insertTextBefore(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
501
+ /**
502
+ * Inserts text before the specified range.
503
+ * @param range The range to insert before.
504
+ * @param text The edit to insert before the range.
505
+ */
506
+ insertTextBeforeRange(range: SourceRange$1, text: string): RuleTextEdit;
507
+ /**
508
+ * Removes the specified node or token.
509
+ * @param syntaxElement A syntax element with location information to remove.
510
+ * @returns The edit to remove the node or token.
511
+ */
512
+ remove(syntaxElement: EditableSyntaxElement): RuleTextEdit;
513
+ /**
514
+ * Removes the specified range.
515
+ * @param range The range to remove.
516
+ * @returns The edit to remove the range.
517
+ */
518
+ removeRange(range: SourceRange$1): RuleTextEdit;
519
+ /**
520
+ * Replaces the specified node or token with the given text.
521
+ * @param syntaxElement A syntax element with location information to replace.
522
+ * @param text The text to replace the node or token with.
523
+ * @returns The edit to replace the node or token.
524
+ */
525
+ replaceText(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
526
+ /**
527
+ * Replaces the specified range with the given text.
528
+ * @param range The range to replace.
529
+ * @param text The text to replace the range with.
530
+ * @returns The edit to replace the range.
531
+ */
532
+ replaceTextRange(range: SourceRange$1, text: string): RuleTextEdit;
533
+ }
534
+ /**
535
+ * Represents a fix for a rule violation implemented as a text edit.
536
+ */
537
+ interface RuleTextEdit {
538
+ /**
539
+ * The range to replace.
540
+ */
541
+ range: SourceRange$1;
542
+ /**
543
+ * The text to insert.
544
+ */
545
+ text: string;
546
+ }
547
+ /**
548
+ * Fixes a violation.
549
+ * @param fixer The text editor to apply the fix.
550
+ * @returns The fix(es) for the violation.
551
+ */
552
+ type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
553
+ /**
554
+ * Data that can be used to fill placeholders in error messages.
555
+ */
556
+ type MessagePlaceholderData = Record<string, string | number | boolean | bigint | null | undefined>;
557
+ interface ViolationReportBase<MessageIds extends string = string> {
558
+ /**
559
+ * The data to insert into the message.
560
+ */
561
+ data?: MessagePlaceholderData | undefined;
562
+ /**
563
+ * The fix to be applied for the violation.
564
+ */
565
+ fix?: RuleFixer | null | undefined;
566
+ /**
567
+ * An array of suggested fixes for the problem. These fixes may change the
568
+ * behavior of the code, so they are not applied automatically.
569
+ */
570
+ suggest?: SuggestedEdit<MessageIds>[] | null | undefined;
571
+ }
572
+ type ViolationMessage<MessageIds extends string = string> = {
573
+ message: string;
574
+ } | {
575
+ messageId: MessageIds;
576
+ };
577
+ type ViolationLocation<Node> = {
578
+ loc: SourceLocation$1 | Position;
579
+ } | {
580
+ node: Node;
581
+ };
582
+ type ViolationReport<Node = unknown, MessageIds extends string = string> = ViolationReportBase<MessageIds> & ViolationMessage<MessageIds> & ViolationLocation<Node>;
583
+ interface SuggestedEditBase {
584
+ /**
585
+ * The data to insert into the message.
586
+ */
587
+ data?: MessagePlaceholderData | undefined;
588
+ /**
589
+ * The fix to be applied for the suggestion.
590
+ */
591
+ fix: RuleFixer;
592
+ }
593
+ type SuggestionMessage<MessageIds extends string = string> = {
594
+ desc: string;
595
+ } | {
596
+ messageId: MessageIds;
597
+ };
598
+ /**
599
+ * A suggested edit for a rule violation.
600
+ */
601
+ type SuggestedEdit<MessageIds extends string = string> = SuggestedEditBase & SuggestionMessage<MessageIds>;
602
+ /**
603
+ * The normalized version of a lint suggestion.
604
+ */
605
+ interface LintSuggestion {
606
+ /** A short description. */
607
+ desc: string;
608
+ /** Fix result info. */
609
+ fix: RuleTextEdit;
610
+ /** Id referencing a message for the description. */
611
+ messageId?: string | undefined;
612
+ }
613
+ /**
614
+ * The normalized version of a lint violation message.
615
+ */
616
+ interface LintMessage {
617
+ /** The 1-based column number. */
618
+ column: number;
619
+ /** The 1-based line number. */
620
+ line: number;
621
+ /** The 1-based column number of the end location. */
622
+ endColumn?: number | undefined;
623
+ /** The 1-based line number of the end location. */
624
+ endLine?: number | undefined;
625
+ /** The ID of the rule which makes this message. */
626
+ ruleId: string | null;
627
+ /** The reported message. */
628
+ message: string;
629
+ /** The ID of the message in the rule's meta. */
630
+ messageId?: string | undefined;
631
+ /** If `true` then this is a fatal error. */
632
+ fatal?: true | undefined;
633
+ /** The severity of this message. */
634
+ severity: Exclude<SeverityLevel, 0>;
635
+ /** Information for autofix. */
636
+ fix?: RuleTextEdit | undefined;
637
+ /** Information for suggestions. */
638
+ suggestions?: LintSuggestion[] | undefined;
639
+ }
640
+ /**
641
+ * Generic options for the `RuleDefinition` type.
642
+ */
643
+ interface RuleDefinitionTypeOptions {
644
+ LangOptions: LanguageOptions;
645
+ Code: SourceCode;
646
+ RuleOptions: unknown[];
647
+ Visitor: RuleVisitor$1;
648
+ Node: unknown;
649
+ MessageIds: string;
650
+ ExtRuleDocs: unknown;
651
+ }
652
+ /**
653
+ * The definition of an ESLint rule.
654
+ */
655
+ interface RuleDefinition<Options extends RuleDefinitionTypeOptions = RuleDefinitionTypeOptions> {
656
+ /**
657
+ * The meta information for the rule.
658
+ */
659
+ meta?: RulesMeta<Options["MessageIds"], Options["RuleOptions"], Options["ExtRuleDocs"]>;
660
+ /**
661
+ * Creates the visitor that ESLint uses to apply the rule during traversal.
662
+ * @param context The rule context.
663
+ * @returns The rule visitor.
664
+ */
665
+ create(context: RuleContext<{
666
+ LangOptions: Options["LangOptions"];
667
+ Code: Options["Code"];
668
+ RuleOptions: Options["RuleOptions"];
669
+ Node: Options["Node"];
670
+ MessageIds: Options["MessageIds"];
671
+ }>): Options["Visitor"];
672
+ }
673
+ /**
674
+ * Defaults for non-language-related `RuleDefinition` options.
675
+ * @deprecated Use the same type from `@eslint/plugin-kit` instead.
676
+ */
677
+ interface CustomRuleTypeDefinitions$2 {
678
+ RuleOptions: unknown[];
679
+ MessageIds: string;
680
+ ExtRuleDocs: Record<string, unknown>;
681
+ }
682
+ /**
683
+ * A helper type to define language specific specializations of the `RuleDefinition` type.
684
+ * @deprecated Use the same type from `@eslint/plugin-kit` instead.
685
+ *
686
+ * @example
687
+ * ```ts
688
+ * type YourRuleDefinition<
689
+ * Options extends Partial<CustomRuleTypeDefinitions> = {},
690
+ * > = CustomRuleDefinitionType<
691
+ * {
692
+ * LangOptions: YourLanguageOptions;
693
+ * Code: YourSourceCode;
694
+ * Visitor: YourRuleVisitor;
695
+ * Node: YourNode;
696
+ * },
697
+ * Options
698
+ * >;
699
+ * ```
700
+ */
701
+ type CustomRuleDefinitionType$2<LanguageSpecificOptions extends Omit<RuleDefinitionTypeOptions, keyof CustomRuleTypeDefinitions$2>, Options extends Partial<CustomRuleTypeDefinitions$2>> = RuleDefinition<LanguageSpecificOptions & Required<Options & Omit<CustomRuleTypeDefinitions$2, keyof Options>>>;
702
+ /**
703
+ * The human readable severity level used in a configuration.
704
+ */
705
+ type SeverityName = "off" | "warn" | "error";
706
+ /**
707
+ * The numeric severity level for a rule.
708
+ *
709
+ * - `0` means off.
710
+ * - `1` means warn.
711
+ * - `2` means error.
712
+ */
713
+ type SeverityLevel = 0 | 1 | 2;
714
+ /**
715
+ * The severity of a rule in a configuration.
716
+ */
717
+ type Severity = SeverityName | SeverityLevel;
718
+ /**
719
+ * Represents the metadata for an object, such as a plugin or processor.
720
+ */
721
+ interface ObjectMetaProperties {
722
+ /** @deprecated Use `meta.name` instead. */
723
+ name?: string | undefined;
724
+ /** @deprecated Use `meta.version` instead. */
725
+ version?: string | undefined;
726
+ meta?: {
727
+ name?: string | undefined;
728
+ version?: string | undefined;
729
+ };
730
+ }
731
+ /**
732
+ * Represents the configuration options for the core linter.
733
+ */
734
+ interface LinterOptionsConfig {
735
+ /**
736
+ * Indicates whether or not inline configuration is evaluated.
737
+ */
738
+ noInlineConfig?: boolean;
739
+ /**
740
+ * Indicates what to do when an unused disable directive is found.
741
+ */
742
+ reportUnusedDisableDirectives?: boolean | Severity;
743
+ /**
744
+ * A severity value indicating if and how unused inline configs should be
745
+ * tracked and reported.
746
+ */
747
+ reportUnusedInlineConfigs?: Severity;
748
+ }
749
+ /**
750
+ * The configuration for a rule.
751
+ */
752
+ type RuleConfig$1<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
753
+ /**
754
+ * A collection of rules and their configurations.
755
+ */
756
+ interface RulesConfig$1 {
757
+ [key: string]: RuleConfig$1;
758
+ }
759
+ /**
760
+ * A collection of settings.
761
+ */
762
+ interface SettingsConfig {
763
+ [key: string]: unknown;
764
+ }
765
+ /**
766
+ * The configuration for a set of files.
767
+ */
768
+ interface ConfigObject<Rules extends RulesConfig$1 = RulesConfig$1> {
769
+ /**
770
+ * A string to identify the configuration object. Used in error messages and
771
+ * inspection tools.
772
+ */
773
+ name?: string;
774
+ /**
775
+ * Path to the directory where the configuration object should apply.
776
+ * `files` and `ignores` patterns in the configuration object are
777
+ * interpreted as relative to this path.
778
+ */
779
+ basePath?: string;
780
+ /**
781
+ * An array of glob patterns indicating the files that the configuration
782
+ * object should apply to. If not specified, the configuration object applies
783
+ * to all files
784
+ */
785
+ files?: (string | string[])[];
786
+ /**
787
+ * An array of glob patterns indicating the files that the configuration
788
+ * object should not apply to. If not specified, the configuration object
789
+ * applies to all files matched by files
790
+ */
791
+ ignores?: string[];
792
+ /**
793
+ * The name of the language used for linting. This is used to determine the
794
+ * parser and other language-specific settings.
795
+ * @since 9.7.0
796
+ */
797
+ language?: string;
798
+ /**
799
+ * An object containing settings related to how the language is configured for
800
+ * linting.
801
+ */
802
+ languageOptions?: LanguageOptions;
803
+ /**
804
+ * An object containing settings related to the linting process
805
+ */
806
+ linterOptions?: LinterOptionsConfig;
807
+ /**
808
+ * Either an object containing preprocess() and postprocess() methods or a
809
+ * string indicating the name of a processor inside of a plugin
810
+ * (i.e., "pluginName/processorName").
811
+ */
812
+ processor?: string | Processor;
813
+ /**
814
+ * An object containing a name-value mapping of plugin names to plugin objects.
815
+ * When files is specified, these plugins are only available to the matching files.
816
+ */
817
+ plugins?: Record<string, Plugin>;
818
+ /**
819
+ * An object containing the configured rules. When files or ignores are specified,
820
+ * these rule configurations are only available to the matching files.
821
+ */
822
+ rules?: Partial<Rules>;
823
+ /**
824
+ * An object containing name-value pairs of information that should be
825
+ * available to all rules.
826
+ */
827
+ settings?: SettingsConfig;
828
+ }
829
+ /** @deprecated Only supported in legacy eslintrc config format. */
830
+ type GlobalAccess = boolean | "off" | "readable" | "readonly" | "writable" | "writeable";
831
+ /** @deprecated Only supported in legacy eslintrc config format. */
832
+ interface GlobalsConfig {
833
+ [name: string]: GlobalAccess;
834
+ }
835
+ /**
836
+ * The ECMAScript version of the code being linted.
837
+ * @deprecated Only supported in legacy eslintrc config format.
838
+ */
839
+ type EcmaVersion = 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";
840
+ /**
841
+ * The type of JavaScript source code.
842
+ * @deprecated Only supported in legacy eslintrc config format.
843
+ */
844
+ type JavaScriptSourceType = "script" | "module" | "commonjs";
845
+ /**
846
+ * Parser options.
847
+ * @deprecated Only supported in legacy eslintrc config format.
848
+ * @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options)
849
+ */
850
+ interface JavaScriptParserOptionsConfig {
851
+ /**
852
+ * Allow the use of reserved words as identifiers (if `ecmaVersion` is 3).
853
+ *
854
+ * @default false
855
+ */
856
+ allowReserved?: boolean | undefined;
857
+ /**
858
+ * Accepts any valid ECMAScript version number or `'latest'`:
859
+ *
860
+ * - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, es14, ..., or
861
+ * - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, ..., or
862
+ * - `'latest'`
863
+ *
864
+ * When it's a version or a year, the value must be a number - so do not include the `es` prefix.
865
+ *
866
+ * 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
867
+ *
868
+ * @default 5
869
+ */
870
+ ecmaVersion?: EcmaVersion | undefined;
871
+ /**
872
+ * The type of JavaScript source code. Possible values are "script" for
873
+ * traditional script files, "module" for ECMAScript modules (ESM), and
874
+ * "commonjs" for CommonJS files.
875
+ *
876
+ * @default 'script'
877
+ *
878
+ * @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
879
+ */
880
+ sourceType?: JavaScriptSourceType | undefined;
881
+ /**
882
+ * An object indicating which additional language features you'd like to use.
883
+ *
884
+ * @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
885
+ */
886
+ ecmaFeatures?: {
887
+ globalReturn?: boolean | undefined;
888
+ impliedStrict?: boolean | undefined;
889
+ jsx?: boolean | undefined;
890
+ [key: string]: any;
891
+ } | undefined;
892
+ [key: string]: any;
893
+ }
894
+ /** @deprecated Only supported in legacy eslintrc config format. */
895
+ interface EnvironmentConfig {
896
+ /** The definition of global variables. */
897
+ globals?: GlobalsConfig | undefined;
898
+ /** The parser options that will be enabled under this environment. */
899
+ parserOptions?: JavaScriptParserOptionsConfig | undefined;
900
+ }
901
+ /**
902
+ * A configuration object that may have a `rules` block.
903
+ */
904
+ interface HasRules<Rules extends RulesConfig$1 = RulesConfig$1> {
905
+ rules?: Partial<Rules> | undefined;
906
+ }
907
+ /**
908
+ * ESLint legacy configuration.
909
+ *
910
+ * @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
911
+ */
912
+ interface BaseConfig<Rules extends RulesConfig$1 = RulesConfig$1, OverrideRules extends RulesConfig$1 = Rules> extends HasRules<Rules> {
913
+ $schema?: string | undefined;
914
+ /**
915
+ * An environment provides predefined global variables.
916
+ *
917
+ * @see [Environments](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-environments)
918
+ */
919
+ env?: {
920
+ [name: string]: boolean;
921
+ } | undefined;
922
+ /**
923
+ * Extending configuration files.
924
+ *
925
+ * @see [Extends](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#extending-configuration-files)
926
+ */
927
+ extends?: string | string[] | undefined;
928
+ /**
929
+ * Specifying globals.
930
+ *
931
+ * @see [Globals](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-globals)
932
+ */
933
+ globals?: GlobalsConfig | undefined;
934
+ /**
935
+ * Disable processing of inline comments.
936
+ *
937
+ * @see [Disabling Inline Comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#disabling-inline-comments)
938
+ */
939
+ noInlineConfig?: boolean | undefined;
940
+ /**
941
+ * Overrides can be used to use a differing configuration for matching sub-directories and files.
942
+ *
943
+ * @see [How do overrides work](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#how-do-overrides-work)
944
+ */
945
+ overrides?: ConfigOverride<OverrideRules>[] | undefined;
946
+ /**
947
+ * Parser.
948
+ *
949
+ * @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
950
+ * @see [Specifying Parser](https://eslint.org/docs/latest/use/configure/parser-deprecated)
951
+ */
952
+ parser?: string | undefined;
953
+ /**
954
+ * Parser options.
955
+ *
956
+ * @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
957
+ * @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options)
958
+ */
959
+ parserOptions?: JavaScriptParserOptionsConfig | undefined;
960
+ /**
961
+ * Which third-party plugins define additional rules, environments, configs, etc. for ESLint to use.
962
+ *
963
+ * @see [Configuring Plugins](https://eslint.org/docs/latest/use/configure/plugins-deprecated#configure-plugins)
964
+ */
965
+ plugins?: string[] | undefined;
966
+ /**
967
+ * Specifying processor.
968
+ *
969
+ * @see [processor](https://eslint.org/docs/latest/use/configure/plugins-deprecated#specify-a-processor)
970
+ */
971
+ processor?: string | undefined;
972
+ /**
973
+ * Report unused eslint-disable comments as warning.
974
+ *
975
+ * @see [Report unused eslint-disable comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#report-unused-eslint-disable-comments)
976
+ */
977
+ reportUnusedDisableDirectives?: boolean | undefined;
978
+ /**
979
+ * Settings.
980
+ *
981
+ * @see [Settings](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#adding-shared-settings)
982
+ */
983
+ settings?: SettingsConfig | undefined;
984
+ }
985
+ /**
986
+ * The overwrites that apply more differing configuration to specific files or directories.
987
+ */
988
+ interface ConfigOverride<Rules extends RulesConfig$1 = RulesConfig$1> extends BaseConfig<Rules> {
989
+ /**
990
+ * The glob patterns for excluded files.
991
+ */
992
+ excludedFiles?: string | string[] | undefined;
993
+ /**
994
+ * The glob patterns for target files.
995
+ */
996
+ files: string | string[];
997
+ }
998
+ /**
999
+ * ESLint legacy configuration.
1000
+ *
1001
+ * @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
1002
+ */
1003
+ interface LegacyConfigObject<Rules extends RulesConfig$1 = RulesConfig$1, OverrideRules extends RulesConfig$1 = Rules> extends BaseConfig<Rules, OverrideRules> {
1004
+ /**
1005
+ * Tell ESLint to ignore specific files and directories.
1006
+ *
1007
+ * @see [Ignore Patterns](https://eslint.org/docs/latest/use/configure/ignore-deprecated#ignorepatterns-in-config-files)
1008
+ */
1009
+ ignorePatterns?: string | string[] | undefined;
1010
+ /**
1011
+ * @see [Using Configuration Files](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#using-configuration-files)
1012
+ */
1013
+ root?: boolean | undefined;
1014
+ }
1015
+ /**
1016
+ * File information passed to a processor.
1017
+ */
1018
+ interface ProcessorFile {
1019
+ text: string;
1020
+ filename: string;
1021
+ }
1022
+ /**
1023
+ * A processor is an object that can preprocess and postprocess files.
1024
+ */
1025
+ interface Processor<T extends string | ProcessorFile = string | ProcessorFile> extends ObjectMetaProperties {
1026
+ /** If `true` then it means the processor supports autofix. */
1027
+ supportsAutofix?: boolean | undefined;
1028
+ /** The function to extract code blocks. */
1029
+ preprocess?(text: string, filename: string): T[];
1030
+ /** The function to merge messages. */
1031
+ postprocess?(messages: LintMessage[][], filename: string): LintMessage[];
1032
+ }
1033
+ interface Plugin extends ObjectMetaProperties {
1034
+ meta?: ObjectMetaProperties["meta"] & {
1035
+ namespace?: string | undefined;
1036
+ };
1037
+ configs?: Record<string, LegacyConfigObject | ConfigObject | ConfigObject[]> | undefined;
1038
+ environments?: Record<string, EnvironmentConfig> | undefined;
1039
+ languages?: Record<string, Language> | undefined;
1040
+ processors?: Record<string, Processor> | undefined;
1041
+ rules?: Record<string, RuleDefinition> | undefined;
1042
+ }
1043
+ /**
1044
+ * Generic options for the `Language` type.
1045
+ */
1046
+ interface LanguageTypeOptions {
1047
+ LangOptions: LanguageOptions;
1048
+ Code: SourceCode;
1049
+ RootNode: unknown;
1050
+ Node: unknown;
1051
+ }
1052
+ /**
1053
+ * Represents a plugin language.
1054
+ */
1055
+ interface Language<Options extends LanguageTypeOptions = {
1056
+ LangOptions: LanguageOptions;
1057
+ Code: SourceCode;
1058
+ RootNode: unknown;
1059
+ Node: unknown;
1060
+ }> {
1061
+ /**
1062
+ * Indicates how ESLint should read the file.
1063
+ */
1064
+ fileType: "text";
1065
+ /**
1066
+ * First line number returned from the parser (text mode only).
1067
+ */
1068
+ lineStart: 0 | 1;
1069
+ /**
1070
+ * First column number returned from the parser (text mode only).
1071
+ */
1072
+ columnStart: 0 | 1;
1073
+ /**
1074
+ * The property to read the node type from. Used in selector querying.
1075
+ */
1076
+ nodeTypeKey: string;
1077
+ /**
1078
+ * The traversal path that tools should take when evaluating the AST
1079
+ */
1080
+ visitorKeys?: Record<string, string[]>;
1081
+ /**
1082
+ * Default language options. User-defined options are merged with this object.
1083
+ */
1084
+ defaultLanguageOptions?: Options["LangOptions"];
1085
+ /**
1086
+ * Validates languageOptions for this language.
1087
+ */
1088
+ validateLanguageOptions(languageOptions: Options["LangOptions"]): void;
1089
+ /**
1090
+ * Normalizes languageOptions for this language.
1091
+ */
1092
+ normalizeLanguageOptions?(languageOptions: Options["LangOptions"]): Options["LangOptions"];
1093
+ /**
1094
+ * Helper for esquery that allows languages to match nodes against
1095
+ * class. esquery currently has classes like `function` that will
1096
+ * match all the various function nodes. This method allows languages
1097
+ * to implement similar shorthands.
1098
+ */
1099
+ matchesSelectorClass?(className: string, node: Options["Node"], ancestry: Options["Node"][]): boolean;
1100
+ /**
1101
+ * Parses the given file input into its component parts. This file should not
1102
+ * throws errors for parsing errors but rather should return any parsing
1103
+ * errors as parse of the ParseResult object.
1104
+ */
1105
+ parse(file: File, context: LanguageContext<Options["LangOptions"]>): ParseResult<Options["RootNode"]>;
1106
+ /**
1107
+ * Creates SourceCode object that ESLint uses to work with a file.
1108
+ */
1109
+ createSourceCode(file: File, input: OkParseResult<Options["RootNode"]>, context: LanguageContext<Options["LangOptions"]>): Options["Code"];
1110
+ }
1111
+ /**
1112
+ * Plugin-defined options for the language.
1113
+ */
1114
+ type LanguageOptions = Record<string, unknown>;
1115
+ /**
1116
+ * The context object that is passed to the language plugin methods.
1117
+ */
1118
+ interface LanguageContext<LangOptions = LanguageOptions> {
1119
+ languageOptions: LangOptions;
1120
+ }
1121
+ /**
1122
+ * Represents a file read by ESLint.
1123
+ */
1124
+ interface File {
1125
+ /**
1126
+ * The path that ESLint uses for this file. May be a virtual path
1127
+ * if it was returned by a processor.
1128
+ */
1129
+ path: string;
1130
+ /**
1131
+ * The path to the file on disk. This always maps directly to a file
1132
+ * regardless of whether it was returned from a processor.
1133
+ */
1134
+ physicalPath: string;
1135
+ /**
1136
+ * Indicates if the original source contained a byte-order marker.
1137
+ * ESLint strips the BOM from the `body`, but this info is needed
1138
+ * to correctly apply autofixing.
1139
+ */
1140
+ bom: boolean;
1141
+ /**
1142
+ * The body of the file to parse.
1143
+ */
1144
+ body: string | Uint8Array;
1145
+ }
1146
+ /**
1147
+ * Represents the successful result of parsing a file.
1148
+ */
1149
+ interface OkParseResult<RootNode = unknown> {
1150
+ /**
1151
+ * Indicates if the parse was successful. If true, the parse was successful
1152
+ * and ESLint should continue on to create a SourceCode object and run rules;
1153
+ * if false, ESLint should just report the error(s) without doing anything
1154
+ * else.
1155
+ */
1156
+ ok: true;
1157
+ /**
1158
+ * The abstract syntax tree created by the parser. (only when ok: true)
1159
+ */
1160
+ ast: RootNode;
1161
+ /**
1162
+ * Any additional data that the parser wants to provide.
1163
+ */
1164
+ [key: string]: any;
1165
+ }
1166
+ /**
1167
+ * Represents the unsuccessful result of parsing a file.
1168
+ */
1169
+ interface NotOkParseResult {
1170
+ /**
1171
+ * Indicates if the parse was successful. If true, the parse was successful
1172
+ * and ESLint should continue on to create a SourceCode object and run rules;
1173
+ * if false, ESLint should just report the error(s) without doing anything
1174
+ * else.
1175
+ */
1176
+ ok: false;
1177
+ /**
1178
+ * Any parsing errors, whether fatal or not. (only when ok: false)
1179
+ */
1180
+ errors: FileError[];
1181
+ /**
1182
+ * Any additional data that the parser wants to provide.
1183
+ */
1184
+ [key: string]: any;
1185
+ }
1186
+ type ParseResult<RootNode = unknown> = OkParseResult<RootNode> | NotOkParseResult;
1187
+ /**
1188
+ * Represents inline configuration found in the source code.
1189
+ */
1190
+ interface InlineConfigElement {
1191
+ /**
1192
+ * The location of the inline config element.
1193
+ */
1194
+ loc: SourceLocation$1;
1195
+ /**
1196
+ * The interpreted configuration from the inline config element.
1197
+ */
1198
+ config: {
1199
+ rules: RulesConfig$1;
1200
+ };
1201
+ }
1202
+ /**
1203
+ * Generic options for the `SourceCodeBase` type.
1204
+ */
1205
+ interface SourceCodeBaseTypeOptions$1 {
1206
+ LangOptions: LanguageOptions;
1207
+ RootNode: unknown;
1208
+ SyntaxElementWithLoc: unknown;
1209
+ ConfigNode: unknown;
1210
+ }
1211
+ /**
1212
+ * Represents the basic interface for a source code object.
1213
+ */
1214
+ interface SourceCodeBase<Options extends SourceCodeBaseTypeOptions$1 = {
1215
+ LangOptions: LanguageOptions;
1216
+ RootNode: unknown;
1217
+ SyntaxElementWithLoc: unknown;
1218
+ ConfigNode: unknown;
1219
+ }> {
1220
+ /**
1221
+ * Root of the AST.
1222
+ */
1223
+ ast: Options["RootNode"];
1224
+ /**
1225
+ * The traversal path that tools should take when evaluating the AST.
1226
+ * When present, this overrides the `visitorKeys` on the language for
1227
+ * just this source code object.
1228
+ */
1229
+ visitorKeys?: Record<string, string[]>;
1230
+ /**
1231
+ * Retrieves the equivalent of `loc` for a given node or token.
1232
+ * @param syntaxElement The node or token to get the location for.
1233
+ * @returns The location of the node or token.
1234
+ */
1235
+ getLoc(syntaxElement: Options["SyntaxElementWithLoc"]): SourceLocation$1;
1236
+ /**
1237
+ * Retrieves the equivalent of `range` for a given node or token.
1238
+ * @param syntaxElement The node or token to get the range for.
1239
+ * @returns The range of the node or token.
1240
+ */
1241
+ getRange(syntaxElement: Options["SyntaxElementWithLoc"]): SourceRange$1;
1242
+ /**
1243
+ * Traversal of AST.
1244
+ */
1245
+ traverse(): Iterable<TraversalStep$1>;
1246
+ /**
1247
+ * Applies language options passed in from the ESLint core.
1248
+ */
1249
+ applyLanguageOptions?(languageOptions: Options["LangOptions"]): void;
1250
+ /**
1251
+ * Return all of the inline areas where ESLint should be disabled/enabled
1252
+ * along with any problems found in evaluating the directives.
1253
+ */
1254
+ getDisableDirectives?(): {
1255
+ directives: Directive$1[];
1256
+ problems: FileProblem[];
1257
+ };
1258
+ /**
1259
+ * Returns an array of all inline configuration nodes found in the
1260
+ * source code.
1261
+ */
1262
+ getInlineConfigNodes?(): Options["ConfigNode"][];
1263
+ /**
1264
+ * Applies configuration found inside of the source code. This method is only
1265
+ * called when ESLint is running with inline configuration allowed.
1266
+ */
1267
+ applyInlineConfig?(): {
1268
+ configs: InlineConfigElement[];
1269
+ problems: FileProblem[];
1270
+ };
1271
+ /**
1272
+ * Called by ESLint core to indicate that it has finished providing
1273
+ * information. We now add in all the missing variables and ensure that
1274
+ * state-changing methods cannot be called by rules.
1275
+ * @returns {void}
1276
+ */
1277
+ finalize?(): void;
1278
+ }
1279
+ /**
1280
+ * Represents the source of a text file being linted.
1281
+ */
1282
+ interface TextSourceCode$1<Options extends SourceCodeBaseTypeOptions$1 = {
1283
+ LangOptions: LanguageOptions;
1284
+ RootNode: unknown;
1285
+ SyntaxElementWithLoc: unknown;
1286
+ ConfigNode: unknown;
1287
+ }> extends SourceCodeBase<Options> {
1288
+ /**
1289
+ * The body of the file that you'd like rule developers to access.
1290
+ */
1291
+ text: string;
1292
+ }
1293
+ /**
1294
+ * Represents the source of a binary file being linted.
1295
+ */
1296
+ interface BinarySourceCode<Options extends SourceCodeBaseTypeOptions$1 = {
1297
+ LangOptions: LanguageOptions;
1298
+ RootNode: unknown;
1299
+ SyntaxElementWithLoc: unknown;
1300
+ ConfigNode: unknown;
1301
+ }> extends SourceCodeBase<Options> {
1302
+ /**
1303
+ * The body of the file that you'd like rule developers to access.
1304
+ */
1305
+ body: Uint8Array;
1306
+ }
1307
+ type SourceCode<Options extends SourceCodeBaseTypeOptions$1 = {
1308
+ LangOptions: LanguageOptions;
1309
+ RootNode: unknown;
1310
+ SyntaxElementWithLoc: unknown;
1311
+ ConfigNode: unknown;
1312
+ }> = TextSourceCode$1<Options> | BinarySourceCode<Options>;
1313
+ /**
1314
+ * Represents a traversal step visiting the AST.
1315
+ */
1316
+ interface VisitTraversalStep$1 {
1317
+ kind: 1;
1318
+ target: unknown;
1319
+ phase: 1 | 2;
1320
+ args: unknown[];
1321
+ }
1322
+ /**
1323
+ * Represents a traversal step calling a function.
1324
+ */
1325
+ interface CallTraversalStep$1 {
1326
+ kind: 2;
1327
+ target: string;
1328
+ phase?: string;
1329
+ args: unknown[];
1330
+ }
1331
+ type TraversalStep$1 = VisitTraversalStep$1 | CallTraversalStep$1;
1332
+ /**
1333
+ * The type of disable directive. This determines how ESLint will disable rules.
1334
+ */
1335
+ type DirectiveType$1 = "disable" | "enable" | "disable-line" | "disable-next-line";
1336
+ /**
1337
+ * Represents a disable directive.
1338
+ */
1339
+ interface Directive$1 {
1340
+ /**
1341
+ * The type of directive.
1342
+ */
1343
+ type: DirectiveType$1;
1344
+ /**
1345
+ * The node of the directive. May be in the AST or a comment/token.
1346
+ */
1347
+ node: unknown;
1348
+ /**
1349
+ * The value of the directive.
1350
+ */
1351
+ value: string;
1352
+ /**
1353
+ * The justification for the directive.
1354
+ */
1355
+ justification?: string;
1356
+ }
1357
+ declare namespace types_d_exports {
1358
+ export { BooleanConfig$1 as BooleanConfig, CustomRuleDefinitionType$1 as CustomRuleDefinitionType, CustomRuleTypeDefinitions$1 as CustomRuleTypeDefinitions, CustomRuleVisitorWithExit$1 as CustomRuleVisitorWithExit, StringConfig$1 as StringConfig };
1359
+ }
1360
+ /**
1361
+ * Defaults for non-language-related `RuleDefinition` options.
1362
+ */
1363
+ interface CustomRuleTypeDefinitions$1 {
1364
+ RuleOptions: unknown[];
1365
+ MessageIds: string;
1366
+ ExtRuleDocs: Record<string, unknown>;
1367
+ }
1368
+ /**
1369
+ * A helper type to define language specific specializations of the `RuleDefinition` type.
1370
+ *
1371
+ * @example
1372
+ * ```ts
1373
+ * type YourRuleDefinition<
1374
+ * Options extends Partial<CustomRuleTypeDefinitions> = {},
1375
+ * > = CustomRuleDefinitionType<
1376
+ * {
1377
+ * LangOptions: YourLanguageOptions;
1378
+ * Code: YourSourceCode;
1379
+ * Visitor: YourRuleVisitor;
1380
+ * Node: YourNode;
1381
+ * },
1382
+ * Options
1383
+ * >;
1384
+ * ```
1385
+ */
1386
+ type CustomRuleDefinitionType$1<LanguageSpecificOptions extends Omit<RuleDefinitionTypeOptions, keyof CustomRuleTypeDefinitions$1>, Options extends Partial<CustomRuleTypeDefinitions$1>> = RuleDefinition<LanguageSpecificOptions & Required<Options & Omit<CustomRuleTypeDefinitions$1, keyof Options>>>;
1387
+ /**
1388
+ * Adds matching `:exit` selector properties for each key of a `RuleVisitor`.
1389
+ */
1390
+ type CustomRuleVisitorWithExit$1<RuleVisitorType extends RuleVisitor$1> = { [Key in keyof RuleVisitorType as Key | `${Key & string}:exit`]: RuleVisitorType[Key]; };
1391
+ /**
1392
+ * A map of names to string values, or `null` when no value is provided.
1393
+ */
1394
+ type StringConfig$1 = Record<string, string | null>;
1395
+ /**
1396
+ * A map of names to boolean flags.
1397
+ */
1398
+ type BooleanConfig$1 = Record<string, boolean>;
1399
+ //#endregion
1400
+ //#region node_modules/.pnpm/@eslint+plugin-kit@0.7.3/node_modules/@eslint/plugin-kit/dist/cjs/index.d.cts
1401
+ type VisitTraversalStep = VisitTraversalStep$1;
1402
+ type CallTraversalStep = CallTraversalStep$1;
1403
+ type TraversalStep = TraversalStep$1;
1404
+ type SourceLocation = SourceLocation$1;
1405
+ type SourceLocationWithOffset = SourceLocationWithOffset$1;
1406
+ type SourceRange = SourceRange$1;
1407
+ type IDirective = Directive$1;
1408
+ type DirectiveType = DirectiveType$1;
1409
+ type SourceCodeBaseTypeOptions = SourceCodeBaseTypeOptions$1;
1410
+ type TextSourceCode<Options extends SourceCodeBaseTypeOptions = SourceCodeBaseTypeOptions$1> = TextSourceCode$1<Options>;
1411
+ type RuleVisitor = RuleVisitor$1;
1412
+ type CustomRuleVisitorWithExit<RuleVisitorType extends RuleVisitor> = CustomRuleVisitorWithExit$1<RuleVisitorType>;
1413
+ type CustomRuleTypeDefinitions = CustomRuleTypeDefinitions$1;
1414
+ type CustomRuleDefinitionType<LanguageSpecificOptions extends Omit<RuleDefinitionTypeOptions, keyof CustomRuleTypeDefinitions>, Options extends Partial<CustomRuleTypeDefinitions>> = CustomRuleDefinitionType$1<LanguageSpecificOptions, Options>;
1415
+ type RuleConfig = RuleConfig$1;
1416
+ type RulesConfig = RulesConfig$1;
1417
+ type StringConfig = StringConfig$1;
1418
+ type BooleanConfig = BooleanConfig$1;
1419
+ /**
1420
+ * A class to represent a step in the traversal process where a
1421
+ * method is called.
1422
+ * @implements {CallTraversalStep}
1423
+ */
1424
+ declare class CallMethodStep implements CallTraversalStep {
1425
+ /**
1426
+ * Creates a new instance.
1427
+ * @param {Object} options The options for the step.
1428
+ * @param {string} options.target The target of the step.
1429
+ * @param {Array<any>} options.args The arguments of the step.
1430
+ */
1431
+ constructor({ target, args }: {
1432
+ target: string;
1433
+ args: Array<any>;
1434
+ });
1435
+ /**
1436
+ * The type of the step.
1437
+ * @type {"call"}
1438
+ * @readonly
1439
+ */
1440
+ readonly type: "call";
1441
+ /**
1442
+ * The kind of the step. Represents the same data as the `type` property
1443
+ * but it's a number for performance.
1444
+ * @type {2}
1445
+ * @readonly
1446
+ */
1447
+ readonly kind: 2;
1448
+ /**
1449
+ * The name of the method to call.
1450
+ * @type {string}
1451
+ */
1452
+ target: string;
1453
+ /**
1454
+ * The arguments to pass to the method.
1455
+ * @type {Array<any>}
1456
+ */
1457
+ args: Array<any>;
1458
+ }
1459
+ /**
1460
+ * Object to parse ESLint configuration comments.
1461
+ */
1462
+ declare class ConfigCommentParser {
1463
+ /**
1464
+ * Parses a list of "name:string_value" or/and "name" options divided by comma or
1465
+ * whitespace. Used for "global" comments.
1466
+ * @param {string} string The string to parse.
1467
+ * @returns {StringConfig} Result map object of names and string values, or null values if no value was provided.
1468
+ */
1469
+ parseStringConfig(string: string): StringConfig;
1470
+ /**
1471
+ * Parses a JSON-like config.
1472
+ * @param {string} string The string to parse.
1473
+ * @returns {({ok: true, config: RulesConfig}|{ok: false, error: {message: string}})} Result map object
1474
+ */
1475
+ parseJSONLikeConfig(string: string): ({
1476
+ ok: true;
1477
+ config: RulesConfig;
1478
+ } | {
1479
+ ok: false;
1480
+ error: {
1481
+ message: string;
1482
+ };
1483
+ });
1484
+ /**
1485
+ * Parses a config of values separated by comma.
1486
+ * @param {string} string The string to parse.
1487
+ * @returns {BooleanConfig} Result map of values and true values
1488
+ */
1489
+ parseListConfig(string: string): BooleanConfig;
1490
+ /**
1491
+ * Parses a directive comment into directive text and value.
1492
+ * @param {string} string The string with the directive to be parsed.
1493
+ * @returns {DirectiveComment|undefined} The parsed directive or `undefined` if the directive is invalid.
1494
+ */
1495
+ parseDirective(string: string): DirectiveComment | undefined;
1496
+ #private;
1497
+ }
1498
+ /**
1499
+ * A class to represent a directive comment.
1500
+ * @implements {IDirective}
1501
+ */
1502
+ declare class Directive implements IDirective {
1503
+ /**
1504
+ * Creates a new instance.
1505
+ * @param {Object} options The options for the directive.
1506
+ * @param {"disable"|"enable"|"disable-next-line"|"disable-line"} options.type The type of directive.
1507
+ * @param {unknown} options.node The node representing the directive.
1508
+ * @param {string} options.value The value of the directive.
1509
+ * @param {string} options.justification The justification for the directive.
1510
+ */
1511
+ constructor({ type, node, value, justification }: {
1512
+ type: "disable" | "enable" | "disable-next-line" | "disable-line";
1513
+ node: unknown;
1514
+ value: string;
1515
+ justification: string;
1516
+ });
1517
+ /**
1518
+ * The type of directive.
1519
+ * @type {DirectiveType}
1520
+ * @readonly
1521
+ */
1522
+ readonly type: DirectiveType;
1523
+ /**
1524
+ * The node representing the directive.
1525
+ * @type {unknown}
1526
+ * @readonly
1527
+ */
1528
+ readonly node: unknown;
1529
+ /**
1530
+ * Everything after the "eslint-disable" portion of the directive,
1531
+ * but before the "--" that indicates the justification.
1532
+ * @type {string}
1533
+ * @readonly
1534
+ */
1535
+ readonly value: string;
1536
+ /**
1537
+ * The justification for the directive.
1538
+ * @type {string}
1539
+ * @readonly
1540
+ */
1541
+ readonly justification: string;
1542
+ }
1543
+ /**
1544
+ * Source Code Base Object
1545
+ * @template {SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}]
1546
+ * @implements {TextSourceCode<Options>}
1547
+ */
1548
+ declare class TextSourceCodeBase<Options extends SourceCodeBaseTypeOptions & {
1549
+ RootNode: object;
1550
+ SyntaxElementWithLoc: object;
1551
+ } = SourceCodeBaseTypeOptions$1 & {
1552
+ RootNode: object;
1553
+ SyntaxElementWithLoc: object;
1554
+ }> implements TextSourceCode<Options> {
1555
+ /**
1556
+ * Creates a new instance.
1557
+ * @param {Object} options The options for the instance.
1558
+ * @param {string} options.text The source code text.
1559
+ * @param {Options['RootNode']} options.ast The root AST node.
1560
+ * @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code. Defaults to `/\r?\n/u`.
1561
+ */
1562
+ constructor({ text, ast, lineEndingPattern }: {
1563
+ text: string;
1564
+ ast: Options["RootNode"];
1565
+ lineEndingPattern?: RegExp;
1566
+ });
1567
+ /**
1568
+ * The AST of the source code.
1569
+ * @type {Options['RootNode']}
1570
+ */
1571
+ ast: Options["RootNode"];
1572
+ /**
1573
+ * The text of the source code.
1574
+ * @type {string}
1575
+ */
1576
+ text: string;
1577
+ /**
1578
+ * Returns the loc information for the given node or token.
1579
+ * @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the loc information for.
1580
+ * @returns {SourceLocation} The loc information for the node or token.
1581
+ * @throws {Error} If the node or token does not have loc information.
1582
+ */
1583
+ getLoc(nodeOrToken: Options["SyntaxElementWithLoc"]): SourceLocation;
1584
+ /**
1585
+ * Converts a source text index into a `{ line: number, column: number }` pair.
1586
+ * @param {number} index The index of a character in a file.
1587
+ * @throws {TypeError|RangeError} If non-numeric index or index out of range.
1588
+ * @returns {{line: number, column: number}} A `{ line: number, column: number }` location object with 0 or 1-indexed line and 0 or 1-indexed column based on language.
1589
+ * @public
1590
+ */
1591
+ public getLocFromIndex(index: number): {
1592
+ line: number;
1593
+ column: number;
1594
+ };
1595
+ /**
1596
+ * Converts a `{ line: number, column: number }` pair into a source text index.
1597
+ * @param {Object} loc A line/column location.
1598
+ * @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
1599
+ * @param {number} loc.column The column number of the location. (0 or 1-indexed based on language.)
1600
+ * @throws {TypeError|RangeError} If `loc` is not an object with a numeric
1601
+ * `line` and `column`, if the `line` is less than or equal to zero or
1602
+ * the `line` or `column` is out of the expected range.
1603
+ * @returns {number} The index of the line/column location in a file.
1604
+ * @public
1605
+ */
1606
+ public getIndexFromLoc(loc: {
1607
+ line: number;
1608
+ column: number;
1609
+ }): number;
1610
+ /**
1611
+ * Returns the range information for the given node or token.
1612
+ * @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the range information for.
1613
+ * @returns {SourceRange} The range information for the node or token.
1614
+ * @throws {Error} If the node or token does not have range information.
1615
+ */
1616
+ getRange(nodeOrToken: Options["SyntaxElementWithLoc"]): SourceRange;
1617
+ /**
1618
+ * Returns the parent of the given node.
1619
+ * @abstract
1620
+ * @param {Options['SyntaxElementWithLoc']} node The node to get the parent of.
1621
+ * @returns {Options['SyntaxElementWithLoc']|undefined} The parent of the node.
1622
+ * @throws {Error} If the method is not implemented in the subclass.
1623
+ */
1624
+ getParent(node: Options["SyntaxElementWithLoc"]): Options["SyntaxElementWithLoc"] | undefined;
1625
+ /**
1626
+ * Gets all the ancestors of a given node
1627
+ * @param {Options['SyntaxElementWithLoc']} node The node
1628
+ * @returns {Array<Options['SyntaxElementWithLoc']>} All the ancestor nodes in the AST, not including the provided node, starting
1629
+ * from the root node at index 0 and going inwards to the parent node.
1630
+ * @throws {TypeError} When `node` is missing.
1631
+ */
1632
+ getAncestors(node: Options["SyntaxElementWithLoc"]): Array<Options["SyntaxElementWithLoc"]>;
1633
+ /**
1634
+ * Gets the source code for the given node.
1635
+ * @param {Options['SyntaxElementWithLoc']} [node] The AST node to get the text for.
1636
+ * If `node` is omitted or falsy (such as `undefined`, `null`, or an empty string),
1637
+ * the entire source text is returned.
1638
+ * @param {number} [beforeCount] The number of characters before the node to retrieve.
1639
+ * @param {number} [afterCount] The number of characters after the node to retrieve.
1640
+ * @returns {string} The text representing the AST node.
1641
+ * @public
1642
+ */
1643
+ public getText(node?: Options["SyntaxElementWithLoc"], beforeCount?: number, afterCount?: number): string;
1644
+ /**
1645
+ * Gets the entire source text split into an array of lines.
1646
+ * @returns {Array<string>} The source text as an array of lines.
1647
+ * @public
1648
+ */
1649
+ public get lines(): Array<string>;
1650
+ /**
1651
+ * Traverse the source code and return the steps that were taken.
1652
+ * @abstract
1653
+ * @returns {Iterable<TraversalStep>} The steps that were taken while traversing the source code.
1654
+ */
1655
+ traverse(): Iterable<TraversalStep>;
1656
+ #private;
1657
+ }
1658
+ /**
1659
+ * A class to represent a step in the traversal process where a node is visited.
1660
+ * @implements {VisitTraversalStep}
1661
+ */
1662
+ declare class VisitNodeStep implements VisitTraversalStep {
1663
+ /**
1664
+ * Creates a new instance.
1665
+ * @param {Object} options The options for the step.
1666
+ * @param {object} options.target The target of the step.
1667
+ * @param {1|2} options.phase The phase of the step.
1668
+ * @param {Array<any>} options.args The arguments of the step.
1669
+ */
1670
+ constructor({ target, phase, args }: {
1671
+ target: object;
1672
+ phase: 1 | 2;
1673
+ args: Array<any>;
1674
+ });
1675
+ /**
1676
+ * The type of the step.
1677
+ * @type {"visit"}
1678
+ * @readonly
1679
+ */
1680
+ readonly type: "visit";
1681
+ /**
1682
+ * The kind of the step. Represents the same data as the `type` property
1683
+ * but it's a number for performance.
1684
+ * @type {1}
1685
+ * @readonly
1686
+ */
1687
+ readonly kind: 1;
1688
+ /**
1689
+ * The target of the step.
1690
+ * @type {object}
1691
+ */
1692
+ target: object;
1693
+ /**
1694
+ * The phase of the step.
1695
+ * @type {1|2}
1696
+ */
1697
+ phase: 1 | 2;
1698
+ /**
1699
+ * The arguments of the step.
1700
+ * @type {Array<any>}
1701
+ */
1702
+ args: Array<any>;
1703
+ }
1704
+ /**
1705
+ * Represents a directive comment.
1706
+ */
1707
+ declare class DirectiveComment {
1708
+ /**
1709
+ * Creates a new directive comment.
1710
+ * @param {string} label The label of the directive.
1711
+ * @param {string} value The value of the directive.
1712
+ * @param {string} justification The justification of the directive.
1713
+ */
1714
+ constructor(label: string, value: string, justification: string);
1715
+ /**
1716
+ * The label of the directive, such as "eslint", "eslint-disable", etc.
1717
+ * @type {string}
1718
+ */
1719
+ label: string;
1720
+ /**
1721
+ * The value of the directive (the string after the label).
1722
+ * @type {string}
1723
+ */
1724
+ value: string;
1725
+ /**
1726
+ * The justification of the directive (the string after the --).
1727
+ * @type {string}
1728
+ */
1729
+ justification: string;
1730
+ }
1731
+ //#endregion
1732
+ export type { BooleanConfig, CallMethodStep, CallTraversalStep, ConfigCommentParser, CustomRuleDefinitionType, CustomRuleTypeDefinitions, CustomRuleVisitorWithExit, Directive, DirectiveType, IDirective, RuleConfig, RuleVisitor, RulesConfig, SourceCodeBaseTypeOptions, SourceLocation, SourceLocationWithOffset, SourceRange, StringConfig, TextSourceCode, TextSourceCodeBase, TraversalStep, VisitNodeStep, VisitTraversalStep };