@stride.it/appoint-lint-governance 0.1.21 → 0.1.23
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.ts +1852 -20
- package/dist/index.js +248 -192
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,1253 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as eslint from 'eslint';
|
|
2
2
|
import { ESLint } from 'eslint';
|
|
3
|
+
import { JSONSchema4 } from 'json-schema';
|
|
4
|
+
import * as eslint_plugin_regexp from 'eslint-plugin-regexp';
|
|
5
|
+
import * as typescript_eslint from 'typescript-eslint';
|
|
6
|
+
import * as _eslint_core from '@eslint/core';
|
|
7
|
+
import * as comments from '@eslint-community/eslint-plugin-eslint-comments';
|
|
8
|
+
import * as eslint_plugin_jsdoc from 'eslint-plugin-jsdoc';
|
|
3
9
|
|
|
4
|
-
interface
|
|
5
|
-
|
|
10
|
+
interface CompatibleParser {
|
|
11
|
+
parseForESLint(text: string): {
|
|
12
|
+
ast: unknown;
|
|
13
|
+
scopeManager: unknown;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
interface CompatiblePlugin {
|
|
17
|
+
meta: {
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
6
20
|
}
|
|
7
|
-
declare function typescriptBase(options?: TypescriptBaseOptions): typescript_eslint.FlatConfig.ConfigArray;
|
|
8
21
|
|
|
9
|
-
|
|
22
|
+
type TypescriptBaseOptions = {
|
|
10
23
|
files?: string[];
|
|
24
|
+
};
|
|
25
|
+
declare function typescriptBase(options?: TypescriptBaseOptions): {
|
|
26
|
+
files: string[];
|
|
27
|
+
plugins: {
|
|
28
|
+
"@typescript-eslint": CompatiblePlugin;
|
|
29
|
+
};
|
|
30
|
+
languageOptions: {
|
|
31
|
+
parser: CompatibleParser;
|
|
32
|
+
parserOptions: {
|
|
33
|
+
ecmaVersion: string;
|
|
34
|
+
sourceType: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
rules: {
|
|
38
|
+
"@typescript-eslint/consistent-type-imports": string;
|
|
39
|
+
"@typescript-eslint/no-unused-vars": string;
|
|
40
|
+
"@typescript-eslint/no-shadow": string;
|
|
41
|
+
"@typescript-eslint/ban-ts-comment": string;
|
|
42
|
+
"@typescript-eslint/no-explicit-any": string;
|
|
43
|
+
"@typescript-eslint/no-inferrable-types": string;
|
|
44
|
+
"no-undef": string;
|
|
45
|
+
"no-unused-vars": string;
|
|
46
|
+
"no-var": string;
|
|
47
|
+
"prefer-const": string;
|
|
48
|
+
eqeqeq: (string | {
|
|
49
|
+
null: string;
|
|
50
|
+
})[];
|
|
51
|
+
"no-implicit-coercion": string;
|
|
52
|
+
};
|
|
53
|
+
}[];
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @fileoverview Shared types for ESLint Core.
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Represents an error inside of a file.
|
|
61
|
+
*/
|
|
62
|
+
interface FileError {
|
|
63
|
+
message: string;
|
|
64
|
+
line: number;
|
|
65
|
+
column: number;
|
|
66
|
+
endLine?: number;
|
|
67
|
+
endColumn?: number;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Represents a problem found in a file.
|
|
71
|
+
*/
|
|
72
|
+
interface FileProblem {
|
|
73
|
+
ruleId: string | null;
|
|
74
|
+
message: string;
|
|
75
|
+
loc: SourceLocation;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Represents the start and end coordinates of a node inside the source.
|
|
79
|
+
*/
|
|
80
|
+
interface SourceLocation {
|
|
81
|
+
start: Position;
|
|
82
|
+
end: Position;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Represents a location coordinate inside the source. ESLint-style formats
|
|
86
|
+
* have just `line` and `column` while others may have `offset` as well.
|
|
87
|
+
*/
|
|
88
|
+
interface Position {
|
|
89
|
+
line: number;
|
|
90
|
+
column: number;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Represents a range of characters in the source.
|
|
94
|
+
*/
|
|
95
|
+
type SourceRange = [number, number];
|
|
96
|
+
/**
|
|
97
|
+
* What the rule is responsible for finding:
|
|
98
|
+
* - `problem` means the rule has noticed a potential error.
|
|
99
|
+
* - `suggestion` means the rule suggests an alternate or better approach.
|
|
100
|
+
* - `layout` means the rule is looking at spacing, indentation, etc.
|
|
101
|
+
*/
|
|
102
|
+
type RuleType = "problem" | "suggestion" | "layout";
|
|
103
|
+
/**
|
|
104
|
+
* The type of fix the rule can provide:
|
|
105
|
+
* - `code` means the rule can fix syntax.
|
|
106
|
+
* - `whitespace` means the rule can fix spacing and indentation.
|
|
107
|
+
*/
|
|
108
|
+
type RuleFixType = "code" | "whitespace";
|
|
109
|
+
/**
|
|
110
|
+
* An object containing visitor information for a rule. Each method is either the
|
|
111
|
+
* name of a node type or a selector, or is a method that will be called at specific
|
|
112
|
+
* times during the traversal.
|
|
113
|
+
*/
|
|
114
|
+
type RuleVisitor = Record<string, ((...args: any[]) => void) | undefined>;
|
|
115
|
+
/**
|
|
116
|
+
* Rule meta information used for documentation.
|
|
117
|
+
*/
|
|
118
|
+
interface RulesMetaDocs {
|
|
119
|
+
/**
|
|
120
|
+
* A short description of the rule.
|
|
121
|
+
*/
|
|
122
|
+
description?: string | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* The URL to the documentation for the rule.
|
|
125
|
+
*/
|
|
126
|
+
url?: string | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* The category the rule falls under.
|
|
129
|
+
* @deprecated No longer used.
|
|
130
|
+
*/
|
|
131
|
+
category?: string | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Indicates if the rule is generally recommended for all users.
|
|
134
|
+
*
|
|
135
|
+
* Note - this will always be a boolean for core rules, but may be used in any way by plugins.
|
|
136
|
+
*/
|
|
137
|
+
recommended?: unknown;
|
|
138
|
+
/**
|
|
139
|
+
* Indicates if the rule is frozen (no longer accepting feature requests).
|
|
140
|
+
*/
|
|
141
|
+
frozen?: boolean | undefined;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Meta information about a rule.
|
|
145
|
+
*/
|
|
146
|
+
interface RulesMeta<MessageIds extends string = string, RuleOptions = unknown[], ExtRuleDocs = unknown> {
|
|
147
|
+
/**
|
|
148
|
+
* Properties that are used when documenting the rule.
|
|
149
|
+
*/
|
|
150
|
+
docs?: (RulesMetaDocs & ExtRuleDocs) | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* The type of rule.
|
|
153
|
+
*/
|
|
154
|
+
type?: RuleType | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* The schema for the rule options. Required if the rule has options.
|
|
157
|
+
*/
|
|
158
|
+
schema?: JSONSchema4 | JSONSchema4[] | false | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Any default options to be recursively merged on top of any user-provided options.
|
|
161
|
+
*/
|
|
162
|
+
defaultOptions?: RuleOptions;
|
|
163
|
+
/**
|
|
164
|
+
* The messages that the rule can report.
|
|
165
|
+
*/
|
|
166
|
+
messages?: Record<MessageIds, string>;
|
|
167
|
+
/**
|
|
168
|
+
* Indicates whether the rule has been deprecated or provides additional metadata about the deprecation. Omit if not deprecated.
|
|
169
|
+
*/
|
|
170
|
+
deprecated?: boolean | DeprecatedInfo | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* @deprecated Use deprecated.replacedBy instead.
|
|
173
|
+
* The name of the rule(s) this rule was replaced by, if it was deprecated.
|
|
174
|
+
*/
|
|
175
|
+
replacedBy?: readonly string[] | undefined;
|
|
176
|
+
/**
|
|
177
|
+
* Indicates if the rule is fixable, and if so, what type of fix it provides.
|
|
178
|
+
*/
|
|
179
|
+
fixable?: RuleFixType | undefined;
|
|
180
|
+
/**
|
|
181
|
+
* Indicates if the rule may provide suggestions.
|
|
182
|
+
*/
|
|
183
|
+
hasSuggestions?: boolean | undefined;
|
|
184
|
+
/**
|
|
185
|
+
* The language the rule is intended to lint.
|
|
186
|
+
*/
|
|
187
|
+
language?: string;
|
|
188
|
+
/**
|
|
189
|
+
* The dialects of `language` that the rule is intended to lint.
|
|
190
|
+
*/
|
|
191
|
+
dialects?: string[];
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Provides additional metadata about a deprecation.
|
|
195
|
+
*/
|
|
196
|
+
interface DeprecatedInfo {
|
|
197
|
+
/**
|
|
198
|
+
* General message presented to the user, e.g. for the key rule why the rule
|
|
199
|
+
* is deprecated or for info how to replace the rule.
|
|
200
|
+
*/
|
|
201
|
+
message?: string;
|
|
202
|
+
/**
|
|
203
|
+
* URL to more information about this deprecation in general.
|
|
204
|
+
*/
|
|
205
|
+
url?: string;
|
|
206
|
+
/**
|
|
207
|
+
* An empty array explicitly states that there is no replacement.
|
|
208
|
+
*/
|
|
209
|
+
replacedBy?: ReplacedByInfo[];
|
|
210
|
+
/**
|
|
211
|
+
* The package version since when the rule is deprecated (should use full
|
|
212
|
+
* semver without a leading "v").
|
|
213
|
+
*/
|
|
214
|
+
deprecatedSince?: string;
|
|
215
|
+
/**
|
|
216
|
+
* The estimated version when the rule is removed (probably the next major
|
|
217
|
+
* version). null means the rule is "frozen" (will be available but will not
|
|
218
|
+
* be changed).
|
|
219
|
+
*/
|
|
220
|
+
availableUntil?: string | null;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Provides metadata about a replacement
|
|
224
|
+
*/
|
|
225
|
+
interface ReplacedByInfo {
|
|
226
|
+
/**
|
|
227
|
+
* General message presented to the user, e.g. how to replace the rule
|
|
228
|
+
*/
|
|
229
|
+
message?: string;
|
|
230
|
+
/**
|
|
231
|
+
* URL to more information about this replacement in general
|
|
232
|
+
*/
|
|
233
|
+
url?: string;
|
|
234
|
+
/**
|
|
235
|
+
* Name should be "eslint" if the replacement is an ESLint core rule. Omit
|
|
236
|
+
* the property if the replacement is in the same plugin.
|
|
237
|
+
*/
|
|
238
|
+
plugin?: ExternalSpecifier;
|
|
239
|
+
/**
|
|
240
|
+
* Name and documentation of the replacement rule
|
|
241
|
+
*/
|
|
242
|
+
rule?: ExternalSpecifier;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Specifies the name and url of an external resource. At least one property
|
|
246
|
+
* should be set.
|
|
247
|
+
*/
|
|
248
|
+
interface ExternalSpecifier {
|
|
249
|
+
/**
|
|
250
|
+
* Name of the referenced plugin / rule.
|
|
251
|
+
*/
|
|
252
|
+
name?: string;
|
|
253
|
+
/**
|
|
254
|
+
* URL pointing to documentation for the plugin / rule.
|
|
255
|
+
*/
|
|
256
|
+
url?: string;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Generic type for `RuleContext`.
|
|
260
|
+
*/
|
|
261
|
+
interface RuleContextTypeOptions {
|
|
262
|
+
LangOptions: LanguageOptions;
|
|
263
|
+
Code: SourceCode;
|
|
264
|
+
RuleOptions: unknown[];
|
|
265
|
+
Node: unknown;
|
|
266
|
+
MessageIds: string;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Represents the context object that is passed to a rule. This object contains
|
|
270
|
+
* information about the current state of the linting process and is the rule's
|
|
271
|
+
* view into the outside world.
|
|
272
|
+
*/
|
|
273
|
+
interface RuleContext<Options extends RuleContextTypeOptions = RuleContextTypeOptions> {
|
|
274
|
+
/**
|
|
275
|
+
* The current working directory for the session.
|
|
276
|
+
*/
|
|
277
|
+
cwd: string;
|
|
278
|
+
/**
|
|
279
|
+
* Returns the current working directory for the session.
|
|
280
|
+
* @deprecated Use `cwd` instead.
|
|
281
|
+
*/
|
|
282
|
+
getCwd(): string;
|
|
283
|
+
/**
|
|
284
|
+
* The filename of the file being linted.
|
|
285
|
+
*/
|
|
286
|
+
filename: string;
|
|
287
|
+
/**
|
|
288
|
+
* Returns the filename of the file being linted.
|
|
289
|
+
* @deprecated Use `filename` instead.
|
|
290
|
+
*/
|
|
291
|
+
getFilename(): string;
|
|
292
|
+
/**
|
|
293
|
+
* The physical filename of the file being linted.
|
|
294
|
+
*/
|
|
295
|
+
physicalFilename: string;
|
|
296
|
+
/**
|
|
297
|
+
* Returns the physical filename of the file being linted.
|
|
298
|
+
* @deprecated Use `physicalFilename` instead.
|
|
299
|
+
*/
|
|
300
|
+
getPhysicalFilename(): string;
|
|
301
|
+
/**
|
|
302
|
+
* The source code object that the rule is running on.
|
|
303
|
+
*/
|
|
304
|
+
sourceCode: Options["Code"];
|
|
305
|
+
/**
|
|
306
|
+
* Returns the source code object that the rule is running on.
|
|
307
|
+
* @deprecated Use `sourceCode` instead.
|
|
308
|
+
*/
|
|
309
|
+
getSourceCode(): Options["Code"];
|
|
310
|
+
/**
|
|
311
|
+
* Shared settings for the configuration.
|
|
312
|
+
*/
|
|
313
|
+
settings: SettingsConfig;
|
|
314
|
+
/**
|
|
315
|
+
* Parser-specific options for the configuration.
|
|
316
|
+
* @deprecated Use `languageOptions.parserOptions` instead.
|
|
317
|
+
*/
|
|
318
|
+
parserOptions: Record<string, unknown>;
|
|
319
|
+
/**
|
|
320
|
+
* The language options for the configuration.
|
|
321
|
+
*/
|
|
322
|
+
languageOptions: Options["LangOptions"];
|
|
323
|
+
/**
|
|
324
|
+
* The CommonJS path to the parser used while parsing this file.
|
|
325
|
+
* @deprecated No longer used.
|
|
326
|
+
*/
|
|
327
|
+
parserPath: string | undefined;
|
|
328
|
+
/**
|
|
329
|
+
* The rule ID.
|
|
330
|
+
*/
|
|
331
|
+
id: string;
|
|
332
|
+
/**
|
|
333
|
+
* The rule's configured options.
|
|
334
|
+
*/
|
|
335
|
+
options: Options["RuleOptions"];
|
|
336
|
+
/**
|
|
337
|
+
* The report function that the rule should use to report problems.
|
|
338
|
+
* @param violation The violation to report.
|
|
339
|
+
*/
|
|
340
|
+
report(violation: ViolationReport<Options["Node"], Options["MessageIds"]>): void;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Manager of text edits for a rule fix.
|
|
344
|
+
*/
|
|
345
|
+
interface RuleTextEditor<EditableSyntaxElement = unknown> {
|
|
346
|
+
/**
|
|
347
|
+
* Inserts text after the specified node or token.
|
|
348
|
+
* @param syntaxElement The node or token to insert after.
|
|
349
|
+
* @param text The edit to insert after the node or token.
|
|
350
|
+
*/
|
|
351
|
+
insertTextAfter(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
|
|
352
|
+
/**
|
|
353
|
+
* Inserts text after the specified range.
|
|
354
|
+
* @param range The range to insert after.
|
|
355
|
+
* @param text The edit to insert after the range.
|
|
356
|
+
*/
|
|
357
|
+
insertTextAfterRange(range: SourceRange, text: string): RuleTextEdit;
|
|
358
|
+
/**
|
|
359
|
+
* Inserts text before the specified node or token.
|
|
360
|
+
* @param syntaxElement A syntax element with location information to insert before.
|
|
361
|
+
* @param text The edit to insert before the node or token.
|
|
362
|
+
*/
|
|
363
|
+
insertTextBefore(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
|
|
364
|
+
/**
|
|
365
|
+
* Inserts text before the specified range.
|
|
366
|
+
* @param range The range to insert before.
|
|
367
|
+
* @param text The edit to insert before the range.
|
|
368
|
+
*/
|
|
369
|
+
insertTextBeforeRange(range: SourceRange, text: string): RuleTextEdit;
|
|
370
|
+
/**
|
|
371
|
+
* Removes the specified node or token.
|
|
372
|
+
* @param syntaxElement A syntax element with location information to remove.
|
|
373
|
+
* @returns The edit to remove the node or token.
|
|
374
|
+
*/
|
|
375
|
+
remove(syntaxElement: EditableSyntaxElement): RuleTextEdit;
|
|
376
|
+
/**
|
|
377
|
+
* Removes the specified range.
|
|
378
|
+
* @param range The range to remove.
|
|
379
|
+
* @returns The edit to remove the range.
|
|
380
|
+
*/
|
|
381
|
+
removeRange(range: SourceRange): RuleTextEdit;
|
|
382
|
+
/**
|
|
383
|
+
* Replaces the specified node or token with the given text.
|
|
384
|
+
* @param syntaxElement A syntax element with location information to replace.
|
|
385
|
+
* @param text The text to replace the node or token with.
|
|
386
|
+
* @returns The edit to replace the node or token.
|
|
387
|
+
*/
|
|
388
|
+
replaceText(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
|
|
389
|
+
/**
|
|
390
|
+
* Replaces the specified range with the given text.
|
|
391
|
+
* @param range The range to replace.
|
|
392
|
+
* @param text The text to replace the range with.
|
|
393
|
+
* @returns The edit to replace the range.
|
|
394
|
+
*/
|
|
395
|
+
replaceTextRange(range: SourceRange, text: string): RuleTextEdit;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Represents a fix for a rule violation implemented as a text edit.
|
|
399
|
+
*/
|
|
400
|
+
interface RuleTextEdit {
|
|
401
|
+
/**
|
|
402
|
+
* The range to replace.
|
|
403
|
+
*/
|
|
404
|
+
range: SourceRange;
|
|
405
|
+
/**
|
|
406
|
+
* The text to insert.
|
|
407
|
+
*/
|
|
408
|
+
text: string;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Fixes a violation.
|
|
412
|
+
* @param fixer The text editor to apply the fix.
|
|
413
|
+
* @returns The fix(es) for the violation.
|
|
414
|
+
*/
|
|
415
|
+
type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
|
|
416
|
+
interface ViolationReportBase {
|
|
417
|
+
/**
|
|
418
|
+
* The data to insert into the message.
|
|
419
|
+
*/
|
|
420
|
+
data?: Record<string, unknown> | undefined;
|
|
421
|
+
/**
|
|
422
|
+
* The fix to be applied for the violation.
|
|
423
|
+
*/
|
|
424
|
+
fix?: RuleFixer | null | undefined;
|
|
425
|
+
/**
|
|
426
|
+
* An array of suggested fixes for the problem. These fixes may change the
|
|
427
|
+
* behavior of the code, so they are not applied automatically.
|
|
428
|
+
*/
|
|
429
|
+
suggest?: SuggestedEdit[] | null | undefined;
|
|
430
|
+
}
|
|
431
|
+
type ViolationMessage<MessageIds = string> = {
|
|
432
|
+
message: string;
|
|
433
|
+
} | {
|
|
434
|
+
messageId: MessageIds;
|
|
435
|
+
};
|
|
436
|
+
type ViolationLocation<Node> = {
|
|
437
|
+
loc: SourceLocation | Position;
|
|
438
|
+
} | {
|
|
439
|
+
node: Node;
|
|
440
|
+
};
|
|
441
|
+
type ViolationReport<Node = unknown, MessageIds = string> = ViolationReportBase & ViolationMessage<MessageIds> & ViolationLocation<Node>;
|
|
442
|
+
interface SuggestedEditBase {
|
|
443
|
+
/**
|
|
444
|
+
* The data to insert into the message.
|
|
445
|
+
*/
|
|
446
|
+
data?: Record<string, unknown> | undefined;
|
|
447
|
+
/**
|
|
448
|
+
* The fix to be applied for the suggestion.
|
|
449
|
+
*/
|
|
450
|
+
fix: RuleFixer;
|
|
451
|
+
}
|
|
452
|
+
type SuggestionMessage = {
|
|
453
|
+
desc: string;
|
|
454
|
+
} | {
|
|
455
|
+
messageId: string;
|
|
456
|
+
};
|
|
457
|
+
/**
|
|
458
|
+
* A suggested edit for a rule violation.
|
|
459
|
+
*/
|
|
460
|
+
type SuggestedEdit = SuggestedEditBase & SuggestionMessage;
|
|
461
|
+
/**
|
|
462
|
+
* The normalized version of a lint suggestion.
|
|
463
|
+
*/
|
|
464
|
+
interface LintSuggestion {
|
|
465
|
+
/** A short description. */
|
|
466
|
+
desc: string;
|
|
467
|
+
/** Fix result info. */
|
|
468
|
+
fix: RuleTextEdit;
|
|
469
|
+
/** Id referencing a message for the description. */
|
|
470
|
+
messageId?: string | undefined;
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* The normalized version of a lint violation message.
|
|
474
|
+
*/
|
|
475
|
+
interface LintMessage {
|
|
476
|
+
/** The 1-based column number. */
|
|
477
|
+
column: number;
|
|
478
|
+
/** The 1-based line number. */
|
|
479
|
+
line: number;
|
|
480
|
+
/** The 1-based column number of the end location. */
|
|
481
|
+
endColumn?: number | undefined;
|
|
482
|
+
/** The 1-based line number of the end location. */
|
|
483
|
+
endLine?: number | undefined;
|
|
484
|
+
/** The ID of the rule which makes this message. */
|
|
485
|
+
ruleId: string | null;
|
|
486
|
+
/** The reported message. */
|
|
487
|
+
message: string;
|
|
488
|
+
/** The ID of the message in the rule's meta. */
|
|
489
|
+
messageId?: string | undefined;
|
|
490
|
+
/**
|
|
491
|
+
* Type of node.
|
|
492
|
+
* @deprecated `nodeType` is deprecated and will be removed in the next major version.
|
|
493
|
+
*/
|
|
494
|
+
nodeType?: string | undefined;
|
|
495
|
+
/** If `true` then this is a fatal error. */
|
|
496
|
+
fatal?: true | undefined;
|
|
497
|
+
/** The severity of this message. */
|
|
498
|
+
severity: Exclude<SeverityLevel, 0>;
|
|
499
|
+
/** Information for autofix. */
|
|
500
|
+
fix?: RuleTextEdit | undefined;
|
|
501
|
+
/** Information for suggestions. */
|
|
502
|
+
suggestions?: LintSuggestion[] | undefined;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Generic options for the `RuleDefinition` type.
|
|
506
|
+
*/
|
|
507
|
+
interface RuleDefinitionTypeOptions {
|
|
508
|
+
LangOptions: LanguageOptions;
|
|
509
|
+
Code: SourceCode;
|
|
510
|
+
RuleOptions: unknown[];
|
|
511
|
+
Visitor: RuleVisitor;
|
|
512
|
+
Node: unknown;
|
|
513
|
+
MessageIds: string;
|
|
514
|
+
ExtRuleDocs: unknown;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* The definition of an ESLint rule.
|
|
518
|
+
*/
|
|
519
|
+
interface RuleDefinition<Options extends RuleDefinitionTypeOptions = RuleDefinitionTypeOptions> {
|
|
520
|
+
/**
|
|
521
|
+
* The meta information for the rule.
|
|
522
|
+
*/
|
|
523
|
+
meta?: RulesMeta<Options["MessageIds"], Options["RuleOptions"], Options["ExtRuleDocs"]>;
|
|
524
|
+
/**
|
|
525
|
+
* Creates the visitor that ESLint uses to apply the rule during traversal.
|
|
526
|
+
* @param context The rule context.
|
|
527
|
+
* @returns The rule visitor.
|
|
528
|
+
*/
|
|
529
|
+
create(context: RuleContext<{
|
|
530
|
+
LangOptions: Options["LangOptions"];
|
|
531
|
+
Code: Options["Code"];
|
|
532
|
+
RuleOptions: Options["RuleOptions"];
|
|
533
|
+
Node: Options["Node"];
|
|
534
|
+
MessageIds: Options["MessageIds"];
|
|
535
|
+
}>): Options["Visitor"];
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* The human readable severity level used in a configuration.
|
|
539
|
+
*/
|
|
540
|
+
type SeverityName = "off" | "warn" | "error";
|
|
541
|
+
/**
|
|
542
|
+
* The numeric severity level for a rule.
|
|
543
|
+
*
|
|
544
|
+
* - `0` means off.
|
|
545
|
+
* - `1` means warn.
|
|
546
|
+
* - `2` means error.
|
|
547
|
+
*/
|
|
548
|
+
type SeverityLevel = 0 | 1 | 2;
|
|
549
|
+
/**
|
|
550
|
+
* The severity of a rule in a configuration.
|
|
551
|
+
*/
|
|
552
|
+
type Severity = SeverityName | SeverityLevel;
|
|
553
|
+
/**
|
|
554
|
+
* Represents the metadata for an object, such as a plugin or processor.
|
|
555
|
+
*/
|
|
556
|
+
interface ObjectMetaProperties {
|
|
557
|
+
/** @deprecated Use `meta.name` instead. */
|
|
558
|
+
name?: string | undefined;
|
|
559
|
+
/** @deprecated Use `meta.version` instead. */
|
|
560
|
+
version?: string | undefined;
|
|
561
|
+
meta?: {
|
|
562
|
+
name?: string | undefined;
|
|
563
|
+
version?: string | undefined;
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Represents the configuration options for the core linter.
|
|
568
|
+
*/
|
|
569
|
+
interface LinterOptionsConfig {
|
|
570
|
+
/**
|
|
571
|
+
* Indicates whether or not inline configuration is evaluated.
|
|
572
|
+
*/
|
|
573
|
+
noInlineConfig?: boolean;
|
|
574
|
+
/**
|
|
575
|
+
* Indicates what to do when an unused disable directive is found.
|
|
576
|
+
*/
|
|
577
|
+
reportUnusedDisableDirectives?: boolean | Severity;
|
|
578
|
+
/**
|
|
579
|
+
* A severity value indicating if and how unused inline configs should be
|
|
580
|
+
* tracked and reported.
|
|
581
|
+
*/
|
|
582
|
+
reportUnusedInlineConfigs?: Severity;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* The configuration for a rule.
|
|
586
|
+
*/
|
|
587
|
+
type RuleConfig<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
|
|
588
|
+
/**
|
|
589
|
+
* A collection of rules and their configurations.
|
|
590
|
+
*/
|
|
591
|
+
interface RulesConfig {
|
|
592
|
+
[key: string]: RuleConfig;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* A collection of settings.
|
|
596
|
+
*/
|
|
597
|
+
interface SettingsConfig {
|
|
598
|
+
[key: string]: unknown;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* The configuration for a set of files.
|
|
602
|
+
*/
|
|
603
|
+
interface ConfigObject<Rules extends RulesConfig = RulesConfig> {
|
|
604
|
+
/**
|
|
605
|
+
* A string to identify the configuration object. Used in error messages and
|
|
606
|
+
* inspection tools.
|
|
607
|
+
*/
|
|
608
|
+
name?: string;
|
|
609
|
+
/**
|
|
610
|
+
* Path to the directory where the configuration object should apply.
|
|
611
|
+
* `files` and `ignores` patterns in the configuration object are
|
|
612
|
+
* interpreted as relative to this path.
|
|
613
|
+
*/
|
|
614
|
+
basePath?: string;
|
|
615
|
+
/**
|
|
616
|
+
* An array of glob patterns indicating the files that the configuration
|
|
617
|
+
* object should apply to. If not specified, the configuration object applies
|
|
618
|
+
* to all files
|
|
619
|
+
*/
|
|
620
|
+
files?: (string | string[])[];
|
|
621
|
+
/**
|
|
622
|
+
* An array of glob patterns indicating the files that the configuration
|
|
623
|
+
* object should not apply to. If not specified, the configuration object
|
|
624
|
+
* applies to all files matched by files
|
|
625
|
+
*/
|
|
626
|
+
ignores?: string[];
|
|
627
|
+
/**
|
|
628
|
+
* The name of the language used for linting. This is used to determine the
|
|
629
|
+
* parser and other language-specific settings.
|
|
630
|
+
* @since 9.7.0
|
|
631
|
+
*/
|
|
632
|
+
language?: string;
|
|
633
|
+
/**
|
|
634
|
+
* An object containing settings related to how the language is configured for
|
|
635
|
+
* linting.
|
|
636
|
+
*/
|
|
637
|
+
languageOptions?: LanguageOptions;
|
|
638
|
+
/**
|
|
639
|
+
* An object containing settings related to the linting process
|
|
640
|
+
*/
|
|
641
|
+
linterOptions?: LinterOptionsConfig;
|
|
642
|
+
/**
|
|
643
|
+
* Either an object containing preprocess() and postprocess() methods or a
|
|
644
|
+
* string indicating the name of a processor inside of a plugin
|
|
645
|
+
* (i.e., "pluginName/processorName").
|
|
646
|
+
*/
|
|
647
|
+
processor?: string | Processor;
|
|
648
|
+
/**
|
|
649
|
+
* An object containing a name-value mapping of plugin names to plugin objects.
|
|
650
|
+
* When files is specified, these plugins are only available to the matching files.
|
|
651
|
+
*/
|
|
652
|
+
plugins?: Record<string, Plugin>;
|
|
653
|
+
/**
|
|
654
|
+
* An object containing the configured rules. When files or ignores are specified,
|
|
655
|
+
* these rule configurations are only available to the matching files.
|
|
656
|
+
*/
|
|
657
|
+
rules?: Partial<Rules>;
|
|
658
|
+
/**
|
|
659
|
+
* An object containing name-value pairs of information that should be
|
|
660
|
+
* available to all rules.
|
|
661
|
+
*/
|
|
662
|
+
settings?: Record<string, unknown>;
|
|
663
|
+
}
|
|
664
|
+
/** @deprecated Only supported in legacy eslintrc config format. */
|
|
665
|
+
type GlobalAccess = boolean | "off" | "readable" | "readonly" | "writable" | "writeable";
|
|
666
|
+
/** @deprecated Only supported in legacy eslintrc config format. */
|
|
667
|
+
interface GlobalsConfig {
|
|
668
|
+
[name: string]: GlobalAccess;
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* The ECMAScript version of the code being linted.
|
|
672
|
+
* @deprecated Only supported in legacy eslintrc config format.
|
|
673
|
+
*/
|
|
674
|
+
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";
|
|
675
|
+
/**
|
|
676
|
+
* The type of JavaScript source code.
|
|
677
|
+
* @deprecated Only supported in legacy eslintrc config format.
|
|
678
|
+
*/
|
|
679
|
+
type JavaScriptSourceType = "script" | "module" | "commonjs";
|
|
680
|
+
/**
|
|
681
|
+
* Parser options.
|
|
682
|
+
* @deprecated Only supported in legacy eslintrc config format.
|
|
683
|
+
* @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options)
|
|
684
|
+
*/
|
|
685
|
+
interface JavaScriptParserOptionsConfig {
|
|
686
|
+
/**
|
|
687
|
+
* Allow the use of reserved words as identifiers (if `ecmaVersion` is 3).
|
|
688
|
+
*
|
|
689
|
+
* @default false
|
|
690
|
+
*/
|
|
691
|
+
allowReserved?: boolean | undefined;
|
|
692
|
+
/**
|
|
693
|
+
* Accepts any valid ECMAScript version number or `'latest'`:
|
|
694
|
+
*
|
|
695
|
+
* - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, es14, ..., or
|
|
696
|
+
* - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, ..., or
|
|
697
|
+
* - `'latest'`
|
|
698
|
+
*
|
|
699
|
+
* When it's a version or a year, the value must be a number - so do not include the `es` prefix.
|
|
700
|
+
*
|
|
701
|
+
* 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
|
|
702
|
+
*
|
|
703
|
+
* @default 5
|
|
704
|
+
*/
|
|
705
|
+
ecmaVersion?: EcmaVersion | undefined;
|
|
706
|
+
/**
|
|
707
|
+
* The type of JavaScript source code. Possible values are "script" for
|
|
708
|
+
* traditional script files, "module" for ECMAScript modules (ESM), and
|
|
709
|
+
* "commonjs" for CommonJS files.
|
|
710
|
+
*
|
|
711
|
+
* @default 'script'
|
|
712
|
+
*
|
|
713
|
+
* @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
|
|
714
|
+
*/
|
|
715
|
+
sourceType?: JavaScriptSourceType | undefined;
|
|
716
|
+
/**
|
|
717
|
+
* An object indicating which additional language features you'd like to use.
|
|
718
|
+
*
|
|
719
|
+
* @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
|
|
720
|
+
*/
|
|
721
|
+
ecmaFeatures?: {
|
|
722
|
+
globalReturn?: boolean | undefined;
|
|
723
|
+
impliedStrict?: boolean | undefined;
|
|
724
|
+
jsx?: boolean | undefined;
|
|
725
|
+
experimentalObjectRestSpread?: boolean | undefined;
|
|
726
|
+
[key: string]: any;
|
|
727
|
+
} | undefined;
|
|
728
|
+
[key: string]: any;
|
|
729
|
+
}
|
|
730
|
+
/** @deprecated Only supported in legacy eslintrc config format. */
|
|
731
|
+
interface EnvironmentConfig {
|
|
732
|
+
/** The definition of global variables. */
|
|
733
|
+
globals?: GlobalsConfig | undefined;
|
|
734
|
+
/** The parser options that will be enabled under this environment. */
|
|
735
|
+
parserOptions?: JavaScriptParserOptionsConfig | undefined;
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* A configuration object that may have a `rules` block.
|
|
739
|
+
*/
|
|
740
|
+
interface HasRules<Rules extends RulesConfig = RulesConfig> {
|
|
741
|
+
rules?: Partial<Rules> | undefined;
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* ESLint legacy configuration.
|
|
745
|
+
*
|
|
746
|
+
* @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
|
|
747
|
+
*/
|
|
748
|
+
interface BaseConfig<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> extends HasRules<Rules> {
|
|
749
|
+
$schema?: string | undefined;
|
|
750
|
+
/**
|
|
751
|
+
* An environment provides predefined global variables.
|
|
752
|
+
*
|
|
753
|
+
* @see [Environments](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-environments)
|
|
754
|
+
*/
|
|
755
|
+
env?: {
|
|
756
|
+
[name: string]: boolean;
|
|
757
|
+
} | undefined;
|
|
758
|
+
/**
|
|
759
|
+
* Extending configuration files.
|
|
760
|
+
*
|
|
761
|
+
* @see [Extends](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#extending-configuration-files)
|
|
762
|
+
*/
|
|
763
|
+
extends?: string | string[] | undefined;
|
|
764
|
+
/**
|
|
765
|
+
* Specifying globals.
|
|
766
|
+
*
|
|
767
|
+
* @see [Globals](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-globals)
|
|
768
|
+
*/
|
|
769
|
+
globals?: GlobalsConfig | undefined;
|
|
770
|
+
/**
|
|
771
|
+
* Disable processing of inline comments.
|
|
772
|
+
*
|
|
773
|
+
* @see [Disabling Inline Comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#disabling-inline-comments)
|
|
774
|
+
*/
|
|
775
|
+
noInlineConfig?: boolean | undefined;
|
|
776
|
+
/**
|
|
777
|
+
* Overrides can be used to use a differing configuration for matching sub-directories and files.
|
|
778
|
+
*
|
|
779
|
+
* @see [How do overrides work](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#how-do-overrides-work)
|
|
780
|
+
*/
|
|
781
|
+
overrides?: ConfigOverride<OverrideRules>[] | undefined;
|
|
782
|
+
/**
|
|
783
|
+
* Parser.
|
|
784
|
+
*
|
|
785
|
+
* @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
|
|
786
|
+
* @see [Specifying Parser](https://eslint.org/docs/latest/use/configure/parser-deprecated)
|
|
787
|
+
*/
|
|
788
|
+
parser?: string | undefined;
|
|
789
|
+
/**
|
|
790
|
+
* Parser options.
|
|
791
|
+
*
|
|
792
|
+
* @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
|
|
793
|
+
* @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options)
|
|
794
|
+
*/
|
|
795
|
+
parserOptions?: JavaScriptParserOptionsConfig | undefined;
|
|
796
|
+
/**
|
|
797
|
+
* Which third-party plugins define additional rules, environments, configs, etc. for ESLint to use.
|
|
798
|
+
*
|
|
799
|
+
* @see [Configuring Plugins](https://eslint.org/docs/latest/use/configure/plugins-deprecated#configure-plugins)
|
|
800
|
+
*/
|
|
801
|
+
plugins?: string[] | undefined;
|
|
802
|
+
/**
|
|
803
|
+
* Specifying processor.
|
|
804
|
+
*
|
|
805
|
+
* @see [processor](https://eslint.org/docs/latest/use/configure/plugins-deprecated#specify-a-processor)
|
|
806
|
+
*/
|
|
807
|
+
processor?: string | undefined;
|
|
808
|
+
/**
|
|
809
|
+
* Report unused eslint-disable comments as warning.
|
|
810
|
+
*
|
|
811
|
+
* @see [Report unused eslint-disable comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#report-unused-eslint-disable-comments)
|
|
812
|
+
*/
|
|
813
|
+
reportUnusedDisableDirectives?: boolean | undefined;
|
|
814
|
+
/**
|
|
815
|
+
* Settings.
|
|
816
|
+
*
|
|
817
|
+
* @see [Settings](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#adding-shared-settings)
|
|
818
|
+
*/
|
|
819
|
+
settings?: SettingsConfig | undefined;
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* The overwrites that apply more differing configuration to specific files or directories.
|
|
823
|
+
*/
|
|
824
|
+
interface ConfigOverride<Rules extends RulesConfig = RulesConfig> extends BaseConfig<Rules> {
|
|
825
|
+
/**
|
|
826
|
+
* The glob patterns for excluded files.
|
|
827
|
+
*/
|
|
828
|
+
excludedFiles?: string | string[] | undefined;
|
|
829
|
+
/**
|
|
830
|
+
* The glob patterns for target files.
|
|
831
|
+
*/
|
|
832
|
+
files: string | string[];
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* ESLint legacy configuration.
|
|
836
|
+
*
|
|
837
|
+
* @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
|
|
838
|
+
*/
|
|
839
|
+
interface LegacyConfigObject<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> extends BaseConfig<Rules, OverrideRules> {
|
|
840
|
+
/**
|
|
841
|
+
* Tell ESLint to ignore specific files and directories.
|
|
842
|
+
*
|
|
843
|
+
* @see [Ignore Patterns](https://eslint.org/docs/latest/use/configure/ignore-deprecated#ignorepatterns-in-config-files)
|
|
844
|
+
*/
|
|
845
|
+
ignorePatterns?: string | string[] | undefined;
|
|
846
|
+
/**
|
|
847
|
+
* @see [Using Configuration Files](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#using-configuration-files)
|
|
848
|
+
*/
|
|
849
|
+
root?: boolean | undefined;
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* File information passed to a processor.
|
|
853
|
+
*/
|
|
854
|
+
interface ProcessorFile {
|
|
855
|
+
text: string;
|
|
856
|
+
filename: string;
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* A processor is an object that can preprocess and postprocess files.
|
|
860
|
+
*/
|
|
861
|
+
interface Processor<T extends string | ProcessorFile = string | ProcessorFile> extends ObjectMetaProperties {
|
|
862
|
+
/** If `true` then it means the processor supports autofix. */
|
|
863
|
+
supportsAutofix?: boolean | undefined;
|
|
864
|
+
/** The function to extract code blocks. */
|
|
865
|
+
preprocess?(text: string, filename: string): T[];
|
|
866
|
+
/** The function to merge messages. */
|
|
867
|
+
postprocess?(messages: LintMessage[][], filename: string): LintMessage[];
|
|
868
|
+
}
|
|
869
|
+
interface Plugin extends ObjectMetaProperties {
|
|
870
|
+
meta?: ObjectMetaProperties["meta"] & {
|
|
871
|
+
namespace?: string | undefined;
|
|
872
|
+
};
|
|
873
|
+
configs?: Record<string, LegacyConfigObject | ConfigObject | ConfigObject[]> | undefined;
|
|
874
|
+
environments?: Record<string, EnvironmentConfig> | undefined;
|
|
875
|
+
languages?: Record<string, Language> | undefined;
|
|
876
|
+
processors?: Record<string, Processor> | undefined;
|
|
877
|
+
rules?: Record<string, RuleDefinition> | undefined;
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Generic options for the `Language` type.
|
|
881
|
+
*/
|
|
882
|
+
interface LanguageTypeOptions {
|
|
883
|
+
LangOptions: LanguageOptions;
|
|
884
|
+
Code: SourceCode;
|
|
885
|
+
RootNode: unknown;
|
|
886
|
+
Node: unknown;
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* Represents a plugin language.
|
|
890
|
+
*/
|
|
891
|
+
interface Language<Options extends LanguageTypeOptions = {
|
|
892
|
+
LangOptions: LanguageOptions;
|
|
893
|
+
Code: SourceCode;
|
|
894
|
+
RootNode: unknown;
|
|
895
|
+
Node: unknown;
|
|
896
|
+
}> {
|
|
897
|
+
/**
|
|
898
|
+
* Indicates how ESLint should read the file.
|
|
899
|
+
*/
|
|
900
|
+
fileType: "text";
|
|
901
|
+
/**
|
|
902
|
+
* First line number returned from the parser (text mode only).
|
|
903
|
+
*/
|
|
904
|
+
lineStart: 0 | 1;
|
|
905
|
+
/**
|
|
906
|
+
* First column number returned from the parser (text mode only).
|
|
907
|
+
*/
|
|
908
|
+
columnStart: 0 | 1;
|
|
909
|
+
/**
|
|
910
|
+
* The property to read the node type from. Used in selector querying.
|
|
911
|
+
*/
|
|
912
|
+
nodeTypeKey: string;
|
|
913
|
+
/**
|
|
914
|
+
* The traversal path that tools should take when evaluating the AST
|
|
915
|
+
*/
|
|
916
|
+
visitorKeys?: Record<string, string[]>;
|
|
917
|
+
/**
|
|
918
|
+
* Default language options. User-defined options are merged with this object.
|
|
919
|
+
*/
|
|
920
|
+
defaultLanguageOptions?: LanguageOptions;
|
|
921
|
+
/**
|
|
922
|
+
* Validates languageOptions for this language.
|
|
923
|
+
*/
|
|
924
|
+
validateLanguageOptions(languageOptions: Options["LangOptions"]): void;
|
|
925
|
+
/**
|
|
926
|
+
* Normalizes languageOptions for this language.
|
|
927
|
+
*/
|
|
928
|
+
normalizeLanguageOptions?(languageOptions: Options["LangOptions"]): Options["LangOptions"];
|
|
929
|
+
/**
|
|
930
|
+
* Helper for esquery that allows languages to match nodes against
|
|
931
|
+
* class. esquery currently has classes like `function` that will
|
|
932
|
+
* match all the various function nodes. This method allows languages
|
|
933
|
+
* to implement similar shorthands.
|
|
934
|
+
*/
|
|
935
|
+
matchesSelectorClass?(className: string, node: Options["Node"], ancestry: Options["Node"][]): boolean;
|
|
936
|
+
/**
|
|
937
|
+
* Parses the given file input into its component parts. This file should not
|
|
938
|
+
* throws errors for parsing errors but rather should return any parsing
|
|
939
|
+
* errors as parse of the ParseResult object.
|
|
940
|
+
*/
|
|
941
|
+
parse(file: File, context: LanguageContext<Options["LangOptions"]>): ParseResult<Options["RootNode"]>;
|
|
942
|
+
/**
|
|
943
|
+
* Creates SourceCode object that ESLint uses to work with a file.
|
|
944
|
+
*/
|
|
945
|
+
createSourceCode(file: File, input: OkParseResult<Options["RootNode"]>, context: LanguageContext<Options["LangOptions"]>): Options["Code"];
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Plugin-defined options for the language.
|
|
949
|
+
*/
|
|
950
|
+
type LanguageOptions = Record<string, unknown>;
|
|
951
|
+
/**
|
|
952
|
+
* The context object that is passed to the language plugin methods.
|
|
953
|
+
*/
|
|
954
|
+
interface LanguageContext<LangOptions = LanguageOptions> {
|
|
955
|
+
languageOptions: LangOptions;
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Represents a file read by ESLint.
|
|
959
|
+
*/
|
|
960
|
+
interface File {
|
|
961
|
+
/**
|
|
962
|
+
* The path that ESLint uses for this file. May be a virtual path
|
|
963
|
+
* if it was returned by a processor.
|
|
964
|
+
*/
|
|
965
|
+
path: string;
|
|
966
|
+
/**
|
|
967
|
+
* The path to the file on disk. This always maps directly to a file
|
|
968
|
+
* regardless of whether it was returned from a processor.
|
|
969
|
+
*/
|
|
970
|
+
physicalPath: string;
|
|
971
|
+
/**
|
|
972
|
+
* Indicates if the original source contained a byte-order marker.
|
|
973
|
+
* ESLint strips the BOM from the `body`, but this info is needed
|
|
974
|
+
* to correctly apply autofixing.
|
|
975
|
+
*/
|
|
976
|
+
bom: boolean;
|
|
977
|
+
/**
|
|
978
|
+
* The body of the file to parse.
|
|
979
|
+
*/
|
|
980
|
+
body: string | Uint8Array;
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* Represents the successful result of parsing a file.
|
|
984
|
+
*/
|
|
985
|
+
interface OkParseResult<RootNode = unknown> {
|
|
986
|
+
/**
|
|
987
|
+
* Indicates if the parse was successful. If true, the parse was successful
|
|
988
|
+
* and ESLint should continue on to create a SourceCode object and run rules;
|
|
989
|
+
* if false, ESLint should just report the error(s) without doing anything
|
|
990
|
+
* else.
|
|
991
|
+
*/
|
|
992
|
+
ok: true;
|
|
993
|
+
/**
|
|
994
|
+
* The abstract syntax tree created by the parser. (only when ok: true)
|
|
995
|
+
*/
|
|
996
|
+
ast: RootNode;
|
|
997
|
+
/**
|
|
998
|
+
* Any additional data that the parser wants to provide.
|
|
999
|
+
*/
|
|
1000
|
+
[key: string]: any;
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* Represents the unsuccessful result of parsing a file.
|
|
1004
|
+
*/
|
|
1005
|
+
interface NotOkParseResult {
|
|
1006
|
+
/**
|
|
1007
|
+
* Indicates if the parse was successful. If true, the parse was successful
|
|
1008
|
+
* and ESLint should continue on to create a SourceCode object and run rules;
|
|
1009
|
+
* if false, ESLint should just report the error(s) without doing anything
|
|
1010
|
+
* else.
|
|
1011
|
+
*/
|
|
1012
|
+
ok: false;
|
|
1013
|
+
/**
|
|
1014
|
+
* Any parsing errors, whether fatal or not. (only when ok: false)
|
|
1015
|
+
*/
|
|
1016
|
+
errors: FileError[];
|
|
1017
|
+
/**
|
|
1018
|
+
* Any additional data that the parser wants to provide.
|
|
1019
|
+
*/
|
|
1020
|
+
[key: string]: any;
|
|
1021
|
+
}
|
|
1022
|
+
type ParseResult<RootNode = unknown> = OkParseResult<RootNode> | NotOkParseResult;
|
|
1023
|
+
/**
|
|
1024
|
+
* Represents inline configuration found in the source code.
|
|
1025
|
+
*/
|
|
1026
|
+
interface InlineConfigElement {
|
|
1027
|
+
/**
|
|
1028
|
+
* The location of the inline config element.
|
|
1029
|
+
*/
|
|
1030
|
+
loc: SourceLocation;
|
|
1031
|
+
/**
|
|
1032
|
+
* The interpreted configuration from the inline config element.
|
|
1033
|
+
*/
|
|
1034
|
+
config: {
|
|
1035
|
+
rules: RulesConfig;
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* Generic options for the `SourceCodeBase` type.
|
|
1040
|
+
*/
|
|
1041
|
+
interface SourceCodeBaseTypeOptions {
|
|
1042
|
+
LangOptions: LanguageOptions;
|
|
1043
|
+
RootNode: unknown;
|
|
1044
|
+
SyntaxElementWithLoc: unknown;
|
|
1045
|
+
ConfigNode: unknown;
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Represents the basic interface for a source code object.
|
|
1049
|
+
*/
|
|
1050
|
+
interface SourceCodeBase<Options extends SourceCodeBaseTypeOptions = {
|
|
1051
|
+
LangOptions: LanguageOptions;
|
|
1052
|
+
RootNode: unknown;
|
|
1053
|
+
SyntaxElementWithLoc: unknown;
|
|
1054
|
+
ConfigNode: unknown;
|
|
1055
|
+
}> {
|
|
1056
|
+
/**
|
|
1057
|
+
* Root of the AST.
|
|
1058
|
+
*/
|
|
1059
|
+
ast: Options["RootNode"];
|
|
1060
|
+
/**
|
|
1061
|
+
* The traversal path that tools should take when evaluating the AST.
|
|
1062
|
+
* When present, this overrides the `visitorKeys` on the language for
|
|
1063
|
+
* just this source code object.
|
|
1064
|
+
*/
|
|
1065
|
+
visitorKeys?: Record<string, string[]>;
|
|
1066
|
+
/**
|
|
1067
|
+
* Retrieves the equivalent of `loc` for a given node or token.
|
|
1068
|
+
* @param syntaxElement The node or token to get the location for.
|
|
1069
|
+
* @returns The location of the node or token.
|
|
1070
|
+
*/
|
|
1071
|
+
getLoc(syntaxElement: Options["SyntaxElementWithLoc"]): SourceLocation;
|
|
1072
|
+
/**
|
|
1073
|
+
* Retrieves the equivalent of `range` for a given node or token.
|
|
1074
|
+
* @param syntaxElement The node or token to get the range for.
|
|
1075
|
+
* @returns The range of the node or token.
|
|
1076
|
+
*/
|
|
1077
|
+
getRange(syntaxElement: Options["SyntaxElementWithLoc"]): SourceRange;
|
|
1078
|
+
/**
|
|
1079
|
+
* Traversal of AST.
|
|
1080
|
+
*/
|
|
1081
|
+
traverse(): Iterable<TraversalStep>;
|
|
1082
|
+
/**
|
|
1083
|
+
* Applies language options passed in from the ESLint core.
|
|
1084
|
+
*/
|
|
1085
|
+
applyLanguageOptions?(languageOptions: Options["LangOptions"]): void;
|
|
1086
|
+
/**
|
|
1087
|
+
* Return all of the inline areas where ESLint should be disabled/enabled
|
|
1088
|
+
* along with any problems found in evaluating the directives.
|
|
1089
|
+
*/
|
|
1090
|
+
getDisableDirectives?(): {
|
|
1091
|
+
directives: Directive[];
|
|
1092
|
+
problems: FileProblem[];
|
|
1093
|
+
};
|
|
1094
|
+
/**
|
|
1095
|
+
* Returns an array of all inline configuration nodes found in the
|
|
1096
|
+
* source code.
|
|
1097
|
+
*/
|
|
1098
|
+
getInlineConfigNodes?(): Options["ConfigNode"][];
|
|
1099
|
+
/**
|
|
1100
|
+
* Applies configuration found inside of the source code. This method is only
|
|
1101
|
+
* called when ESLint is running with inline configuration allowed.
|
|
1102
|
+
*/
|
|
1103
|
+
applyInlineConfig?(): {
|
|
1104
|
+
configs: InlineConfigElement[];
|
|
1105
|
+
problems: FileProblem[];
|
|
1106
|
+
};
|
|
1107
|
+
/**
|
|
1108
|
+
* Called by ESLint core to indicate that it has finished providing
|
|
1109
|
+
* information. We now add in all the missing variables and ensure that
|
|
1110
|
+
* state-changing methods cannot be called by rules.
|
|
1111
|
+
* @returns {void}
|
|
1112
|
+
*/
|
|
1113
|
+
finalize?(): void;
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* Represents the source of a text file being linted.
|
|
1117
|
+
*/
|
|
1118
|
+
interface TextSourceCode<Options extends SourceCodeBaseTypeOptions = {
|
|
1119
|
+
LangOptions: LanguageOptions;
|
|
1120
|
+
RootNode: unknown;
|
|
1121
|
+
SyntaxElementWithLoc: unknown;
|
|
1122
|
+
ConfigNode: unknown;
|
|
1123
|
+
}> extends SourceCodeBase<Options> {
|
|
1124
|
+
/**
|
|
1125
|
+
* The body of the file that you'd like rule developers to access.
|
|
1126
|
+
*/
|
|
1127
|
+
text: string;
|
|
1128
|
+
}
|
|
1129
|
+
/**
|
|
1130
|
+
* Represents the source of a binary file being linted.
|
|
1131
|
+
*/
|
|
1132
|
+
interface BinarySourceCode<Options extends SourceCodeBaseTypeOptions = {
|
|
1133
|
+
LangOptions: LanguageOptions;
|
|
1134
|
+
RootNode: unknown;
|
|
1135
|
+
SyntaxElementWithLoc: unknown;
|
|
1136
|
+
ConfigNode: unknown;
|
|
1137
|
+
}> extends SourceCodeBase<Options> {
|
|
1138
|
+
/**
|
|
1139
|
+
* The body of the file that you'd like rule developers to access.
|
|
1140
|
+
*/
|
|
1141
|
+
body: Uint8Array;
|
|
1142
|
+
}
|
|
1143
|
+
type SourceCode<Options extends SourceCodeBaseTypeOptions = {
|
|
1144
|
+
LangOptions: LanguageOptions;
|
|
1145
|
+
RootNode: unknown;
|
|
1146
|
+
SyntaxElementWithLoc: unknown;
|
|
1147
|
+
ConfigNode: unknown;
|
|
1148
|
+
}> = TextSourceCode<Options> | BinarySourceCode<Options>;
|
|
1149
|
+
/**
|
|
1150
|
+
* Represents a traversal step visiting the AST.
|
|
1151
|
+
*/
|
|
1152
|
+
interface VisitTraversalStep {
|
|
1153
|
+
kind: 1;
|
|
1154
|
+
target: unknown;
|
|
1155
|
+
phase: 1 | 2;
|
|
1156
|
+
args: unknown[];
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Represents a traversal step calling a function.
|
|
1160
|
+
*/
|
|
1161
|
+
interface CallTraversalStep {
|
|
1162
|
+
kind: 2;
|
|
1163
|
+
target: string;
|
|
1164
|
+
phase?: string;
|
|
1165
|
+
args: unknown[];
|
|
1166
|
+
}
|
|
1167
|
+
type TraversalStep = VisitTraversalStep | CallTraversalStep;
|
|
1168
|
+
/**
|
|
1169
|
+
* The type of disable directive. This determines how ESLint will disable rules.
|
|
1170
|
+
*/
|
|
1171
|
+
type DirectiveType = "disable" | "enable" | "disable-line" | "disable-next-line";
|
|
1172
|
+
/**
|
|
1173
|
+
* Represents a disable directive.
|
|
1174
|
+
*/
|
|
1175
|
+
interface Directive {
|
|
1176
|
+
/**
|
|
1177
|
+
* The type of directive.
|
|
1178
|
+
*/
|
|
1179
|
+
type: DirectiveType;
|
|
1180
|
+
/**
|
|
1181
|
+
* The node of the directive. May be in the AST or a comment/token.
|
|
1182
|
+
*/
|
|
1183
|
+
node: unknown;
|
|
1184
|
+
/**
|
|
1185
|
+
* The value of the directive.
|
|
1186
|
+
*/
|
|
1187
|
+
value: string;
|
|
1188
|
+
/**
|
|
1189
|
+
* The justification for the directive.
|
|
1190
|
+
*/
|
|
1191
|
+
justification?: string;
|
|
11
1192
|
}
|
|
12
|
-
|
|
1193
|
+
|
|
1194
|
+
type TypescriptConventionsOptions = {
|
|
1195
|
+
files?: string[];
|
|
1196
|
+
};
|
|
1197
|
+
declare function typescriptConventions(options?: TypescriptConventionsOptions): ({
|
|
1198
|
+
files: string[];
|
|
1199
|
+
plugins: {
|
|
1200
|
+
import: Plugin & {
|
|
1201
|
+
meta: {
|
|
1202
|
+
name: string;
|
|
1203
|
+
version: string;
|
|
1204
|
+
};
|
|
1205
|
+
configs: {
|
|
1206
|
+
"recommended": eslint.Linter.LegacyConfig;
|
|
1207
|
+
"errors": eslint.Linter.LegacyConfig;
|
|
1208
|
+
"warnings": eslint.Linter.LegacyConfig;
|
|
1209
|
+
"stage-0": eslint.Linter.LegacyConfig;
|
|
1210
|
+
"react": eslint.Linter.LegacyConfig;
|
|
1211
|
+
"react-native": eslint.Linter.LegacyConfig;
|
|
1212
|
+
"electron": eslint.Linter.LegacyConfig;
|
|
1213
|
+
"typescript": eslint.Linter.LegacyConfig;
|
|
1214
|
+
};
|
|
1215
|
+
flatConfigs: {
|
|
1216
|
+
"recommended": eslint.Linter.FlatConfig;
|
|
1217
|
+
"errors": eslint.Linter.FlatConfig;
|
|
1218
|
+
"warnings": eslint.Linter.FlatConfig;
|
|
1219
|
+
"stage-0": eslint.Linter.FlatConfig;
|
|
1220
|
+
"react": eslint.Linter.FlatConfig;
|
|
1221
|
+
"react-native": eslint.Linter.FlatConfig;
|
|
1222
|
+
"electron": eslint.Linter.FlatConfig;
|
|
1223
|
+
"typescript": eslint.Linter.FlatConfig;
|
|
1224
|
+
};
|
|
1225
|
+
rules: {
|
|
1226
|
+
[key: string]: eslint.Rule.RuleModule;
|
|
1227
|
+
};
|
|
1228
|
+
};
|
|
1229
|
+
};
|
|
1230
|
+
rules: {
|
|
1231
|
+
"import/no-default-export": string;
|
|
1232
|
+
"@typescript-eslint/consistent-type-definitions": string[];
|
|
1233
|
+
"@typescript-eslint/consistent-type-imports": string;
|
|
1234
|
+
"prefer-arrow-callback": string;
|
|
1235
|
+
};
|
|
1236
|
+
} | {
|
|
1237
|
+
files: string[];
|
|
1238
|
+
rules: {
|
|
1239
|
+
"import/no-default-export": string;
|
|
1240
|
+
"@typescript-eslint/consistent-type-definitions"?: undefined;
|
|
1241
|
+
"@typescript-eslint/consistent-type-imports"?: undefined;
|
|
1242
|
+
"prefer-arrow-callback"?: undefined;
|
|
1243
|
+
};
|
|
1244
|
+
plugins?: undefined;
|
|
1245
|
+
})[];
|
|
13
1246
|
|
|
14
1247
|
type TypescriptConfigFiles = string[];
|
|
15
|
-
|
|
1248
|
+
type TypescriptMinimalOptions = {
|
|
16
1249
|
files?: TypescriptConfigFiles;
|
|
17
|
-
}
|
|
1250
|
+
};
|
|
18
1251
|
/**
|
|
19
1252
|
* MVP TypeScript profile.
|
|
20
1253
|
*
|
|
@@ -23,14 +1256,47 @@ interface TypescriptMinimalOptions {
|
|
|
23
1256
|
* @param options - Configuration options.
|
|
24
1257
|
* @returns The ESLint configuration.
|
|
25
1258
|
*/
|
|
26
|
-
declare function typescriptMinimal(options?: TypescriptMinimalOptions):
|
|
1259
|
+
declare function typescriptMinimal(options?: TypescriptMinimalOptions): {
|
|
1260
|
+
files: string[];
|
|
1261
|
+
plugins: {
|
|
1262
|
+
"@typescript-eslint": CompatiblePlugin;
|
|
1263
|
+
};
|
|
1264
|
+
languageOptions: {
|
|
1265
|
+
parser: CompatibleParser;
|
|
1266
|
+
parserOptions: {
|
|
1267
|
+
ecmaVersion: string;
|
|
1268
|
+
sourceType: string;
|
|
1269
|
+
};
|
|
1270
|
+
};
|
|
1271
|
+
rules: {
|
|
1272
|
+
"@typescript-eslint/consistent-type-imports": string;
|
|
1273
|
+
"@typescript-eslint/no-unused-vars": string;
|
|
1274
|
+
"@typescript-eslint/no-shadow": string;
|
|
1275
|
+
"@typescript-eslint/ban-ts-comment": string;
|
|
1276
|
+
"@typescript-eslint/no-explicit-any": string;
|
|
1277
|
+
"@typescript-eslint/no-inferrable-types": string;
|
|
1278
|
+
"no-undef": string;
|
|
1279
|
+
"no-unused-vars": string;
|
|
1280
|
+
"no-var": string;
|
|
1281
|
+
"prefer-const": string;
|
|
1282
|
+
eqeqeq: (string | {
|
|
1283
|
+
null: string;
|
|
1284
|
+
})[];
|
|
1285
|
+
"no-implicit-coercion": string;
|
|
1286
|
+
};
|
|
1287
|
+
}[];
|
|
27
1288
|
|
|
28
|
-
|
|
1289
|
+
type TypescriptPrettierOptions = {
|
|
29
1290
|
files?: string[];
|
|
30
|
-
}
|
|
31
|
-
declare function typescriptPrettierInterop(options?: TypescriptPrettierOptions):
|
|
1291
|
+
};
|
|
1292
|
+
declare function typescriptPrettierInterop(options?: TypescriptPrettierOptions): {
|
|
1293
|
+
files: string[];
|
|
1294
|
+
rules: {
|
|
1295
|
+
[x: string]: 0 | "off";
|
|
1296
|
+
};
|
|
1297
|
+
}[];
|
|
32
1298
|
|
|
33
|
-
|
|
1299
|
+
type TypescriptRecommendedOptions = {
|
|
34
1300
|
/**
|
|
35
1301
|
* When set, enables type-aware rules (more powerful, can be slower).
|
|
36
1302
|
*
|
|
@@ -51,17 +1317,583 @@ interface TypescriptRecommendedOptions {
|
|
|
51
1317
|
* When true (default), enables strict conventions (e.g. no default exports).
|
|
52
1318
|
*/
|
|
53
1319
|
enableConventions?: boolean;
|
|
54
|
-
}
|
|
55
|
-
declare function typescriptRecommended(options?: TypescriptRecommendedOptions):
|
|
1320
|
+
};
|
|
1321
|
+
declare function typescriptRecommended(options?: TypescriptRecommendedOptions): ({
|
|
1322
|
+
files: string[];
|
|
1323
|
+
plugins: {
|
|
1324
|
+
"@typescript-eslint": CompatiblePlugin;
|
|
1325
|
+
};
|
|
1326
|
+
languageOptions: {
|
|
1327
|
+
parser: CompatibleParser;
|
|
1328
|
+
parserOptions: {
|
|
1329
|
+
ecmaVersion: string;
|
|
1330
|
+
sourceType: string;
|
|
1331
|
+
};
|
|
1332
|
+
};
|
|
1333
|
+
rules: {
|
|
1334
|
+
"@typescript-eslint/consistent-type-imports": string;
|
|
1335
|
+
"@typescript-eslint/no-unused-vars": string;
|
|
1336
|
+
"@typescript-eslint/no-shadow": string;
|
|
1337
|
+
"@typescript-eslint/ban-ts-comment": string;
|
|
1338
|
+
"@typescript-eslint/no-explicit-any": string;
|
|
1339
|
+
"@typescript-eslint/no-inferrable-types": string;
|
|
1340
|
+
"no-undef": string;
|
|
1341
|
+
"no-unused-vars": string;
|
|
1342
|
+
"no-var": string;
|
|
1343
|
+
"prefer-const": string;
|
|
1344
|
+
eqeqeq: (string | {
|
|
1345
|
+
null: string;
|
|
1346
|
+
})[];
|
|
1347
|
+
"no-implicit-coercion": string;
|
|
1348
|
+
};
|
|
1349
|
+
} | {
|
|
1350
|
+
files: string[];
|
|
1351
|
+
plugins: {
|
|
1352
|
+
import: Plugin & {
|
|
1353
|
+
meta: {
|
|
1354
|
+
name: string;
|
|
1355
|
+
version: string;
|
|
1356
|
+
};
|
|
1357
|
+
configs: {
|
|
1358
|
+
"recommended": eslint.Linter.LegacyConfig;
|
|
1359
|
+
"errors": eslint.Linter.LegacyConfig;
|
|
1360
|
+
"warnings": eslint.Linter.LegacyConfig;
|
|
1361
|
+
"stage-0": eslint.Linter.LegacyConfig;
|
|
1362
|
+
"react": eslint.Linter.LegacyConfig;
|
|
1363
|
+
"react-native": eslint.Linter.LegacyConfig;
|
|
1364
|
+
"electron": eslint.Linter.LegacyConfig;
|
|
1365
|
+
"typescript": eslint.Linter.LegacyConfig;
|
|
1366
|
+
};
|
|
1367
|
+
flatConfigs: {
|
|
1368
|
+
"recommended": eslint.Linter.FlatConfig;
|
|
1369
|
+
"errors": eslint.Linter.FlatConfig;
|
|
1370
|
+
"warnings": eslint.Linter.FlatConfig;
|
|
1371
|
+
"stage-0": eslint.Linter.FlatConfig;
|
|
1372
|
+
"react": eslint.Linter.FlatConfig;
|
|
1373
|
+
"react-native": eslint.Linter.FlatConfig;
|
|
1374
|
+
"electron": eslint.Linter.FlatConfig;
|
|
1375
|
+
"typescript": eslint.Linter.FlatConfig;
|
|
1376
|
+
};
|
|
1377
|
+
rules: {
|
|
1378
|
+
[key: string]: eslint.Rule.RuleModule;
|
|
1379
|
+
};
|
|
1380
|
+
};
|
|
1381
|
+
};
|
|
1382
|
+
rules: {
|
|
1383
|
+
"import/no-default-export": string;
|
|
1384
|
+
"@typescript-eslint/consistent-type-definitions": string[];
|
|
1385
|
+
"@typescript-eslint/consistent-type-imports": string;
|
|
1386
|
+
"prefer-arrow-callback": string;
|
|
1387
|
+
};
|
|
1388
|
+
} | {
|
|
1389
|
+
files: string[];
|
|
1390
|
+
rules: {
|
|
1391
|
+
"import/no-default-export": string;
|
|
1392
|
+
"@typescript-eslint/consistent-type-definitions"?: undefined;
|
|
1393
|
+
"@typescript-eslint/consistent-type-imports"?: undefined;
|
|
1394
|
+
"prefer-arrow-callback"?: undefined;
|
|
1395
|
+
};
|
|
1396
|
+
plugins?: undefined;
|
|
1397
|
+
} | {
|
|
1398
|
+
files: string[];
|
|
1399
|
+
plugins: {
|
|
1400
|
+
jsdoc: Plugin & {
|
|
1401
|
+
configs: Record<`flat/${eslint_plugin_jsdoc.ConfigGroups}${eslint_plugin_jsdoc.ConfigVariants}${eslint_plugin_jsdoc.ErrorLevelVariants}`, eslint.Linter.Config> & Record<"examples" | "default-expressions" | "examples-and-default-expressions", eslint.Linter.Config[]> & Record<"flat/recommended-mixed", eslint.Linter.Config[]>;
|
|
1402
|
+
};
|
|
1403
|
+
"eslint-comments": typeof comments;
|
|
1404
|
+
};
|
|
1405
|
+
rules: {
|
|
1406
|
+
"eslint-comments/no-unused-disable": string;
|
|
1407
|
+
"eslint-comments/no-unlimited-disable": string;
|
|
1408
|
+
"eslint-comments/require-description": string;
|
|
1409
|
+
"eslint-comments/disable-enable-pair": string;
|
|
1410
|
+
"jsdoc/check-alignment": string;
|
|
1411
|
+
"jsdoc/require-param": string;
|
|
1412
|
+
"jsdoc/require-returns": string;
|
|
1413
|
+
};
|
|
1414
|
+
} | {
|
|
1415
|
+
files: string[];
|
|
1416
|
+
plugins: {
|
|
1417
|
+
import: Plugin & {
|
|
1418
|
+
meta: {
|
|
1419
|
+
name: string;
|
|
1420
|
+
version: string;
|
|
1421
|
+
};
|
|
1422
|
+
configs: {
|
|
1423
|
+
"recommended": eslint.Linter.LegacyConfig;
|
|
1424
|
+
"errors": eslint.Linter.LegacyConfig;
|
|
1425
|
+
"warnings": eslint.Linter.LegacyConfig;
|
|
1426
|
+
"stage-0": eslint.Linter.LegacyConfig;
|
|
1427
|
+
"react": eslint.Linter.LegacyConfig;
|
|
1428
|
+
"react-native": eslint.Linter.LegacyConfig;
|
|
1429
|
+
"electron": eslint.Linter.LegacyConfig;
|
|
1430
|
+
"typescript": eslint.Linter.LegacyConfig;
|
|
1431
|
+
};
|
|
1432
|
+
flatConfigs: {
|
|
1433
|
+
"recommended": eslint.Linter.FlatConfig;
|
|
1434
|
+
"errors": eslint.Linter.FlatConfig;
|
|
1435
|
+
"warnings": eslint.Linter.FlatConfig;
|
|
1436
|
+
"stage-0": eslint.Linter.FlatConfig;
|
|
1437
|
+
"react": eslint.Linter.FlatConfig;
|
|
1438
|
+
"react-native": eslint.Linter.FlatConfig;
|
|
1439
|
+
"electron": eslint.Linter.FlatConfig;
|
|
1440
|
+
"typescript": eslint.Linter.FlatConfig;
|
|
1441
|
+
};
|
|
1442
|
+
rules: {
|
|
1443
|
+
[key: string]: eslint.Rule.RuleModule;
|
|
1444
|
+
};
|
|
1445
|
+
};
|
|
1446
|
+
"simple-import-sort": Plugin;
|
|
1447
|
+
};
|
|
1448
|
+
settings: {
|
|
1449
|
+
"import/parsers": {
|
|
1450
|
+
"@typescript-eslint/parser": string[];
|
|
1451
|
+
};
|
|
1452
|
+
"import/resolver": {
|
|
1453
|
+
typescript: {
|
|
1454
|
+
alwaysTryTypes: boolean;
|
|
1455
|
+
project: string[];
|
|
1456
|
+
};
|
|
1457
|
+
node: boolean;
|
|
1458
|
+
};
|
|
1459
|
+
};
|
|
1460
|
+
rules: RulesConfig;
|
|
1461
|
+
} | {
|
|
1462
|
+
files: string[];
|
|
1463
|
+
plugins: {
|
|
1464
|
+
unicorn: Plugin & {
|
|
1465
|
+
configs: {
|
|
1466
|
+
recommended: eslint.Linter.FlatConfig;
|
|
1467
|
+
unopinionated: eslint.Linter.FlatConfig;
|
|
1468
|
+
all: eslint.Linter.FlatConfig;
|
|
1469
|
+
"flat/all": eslint.Linter.FlatConfig;
|
|
1470
|
+
"flat/recommended": eslint.Linter.FlatConfig;
|
|
1471
|
+
};
|
|
1472
|
+
};
|
|
1473
|
+
};
|
|
1474
|
+
rules: RulesConfig;
|
|
1475
|
+
} | {
|
|
1476
|
+
files: string[];
|
|
1477
|
+
plugins: {
|
|
1478
|
+
unicorn: Plugin & {
|
|
1479
|
+
configs: {
|
|
1480
|
+
recommended: eslint.Linter.FlatConfig;
|
|
1481
|
+
unopinionated: eslint.Linter.FlatConfig;
|
|
1482
|
+
all: eslint.Linter.FlatConfig;
|
|
1483
|
+
"flat/all": eslint.Linter.FlatConfig;
|
|
1484
|
+
"flat/recommended": eslint.Linter.FlatConfig;
|
|
1485
|
+
};
|
|
1486
|
+
};
|
|
1487
|
+
sonarjs: {
|
|
1488
|
+
rules: {
|
|
1489
|
+
"function-name": eslint.Rule.RuleModule;
|
|
1490
|
+
"class-name": eslint.Rule.RuleModule;
|
|
1491
|
+
"max-lines": eslint.Rule.RuleModule;
|
|
1492
|
+
"no-tab": eslint.Rule.RuleModule;
|
|
1493
|
+
"variable-name": eslint.Rule.RuleModule;
|
|
1494
|
+
"comment-regex": eslint.Rule.RuleModule;
|
|
1495
|
+
"no-commented-code": eslint.Rule.RuleModule;
|
|
1496
|
+
"elseif-without-else": eslint.Rule.RuleModule;
|
|
1497
|
+
"no-fallthrough": eslint.Rule.RuleModule;
|
|
1498
|
+
"nested-control-flow": eslint.Rule.RuleModule;
|
|
1499
|
+
"too-many-break-or-continue-in-loop": eslint.Rule.RuleModule;
|
|
1500
|
+
"max-lines-per-function": eslint.Rule.RuleModule;
|
|
1501
|
+
"no-nested-incdec": eslint.Rule.RuleModule;
|
|
1502
|
+
"no-equals-in-for-termination": eslint.Rule.RuleModule;
|
|
1503
|
+
"no-extra-arguments": eslint.Rule.RuleModule;
|
|
1504
|
+
"no-collapsible-if": eslint.Rule.RuleModule;
|
|
1505
|
+
"expression-complexity": eslint.Rule.RuleModule;
|
|
1506
|
+
"no-redundant-parentheses": eslint.Rule.RuleModule;
|
|
1507
|
+
"no-labels": eslint.Rule.RuleModule;
|
|
1508
|
+
"no-nested-assignment": eslint.Rule.RuleModule;
|
|
1509
|
+
"no-redundant-boolean": eslint.Rule.RuleModule;
|
|
1510
|
+
"prefer-single-boolean-return": eslint.Rule.RuleModule;
|
|
1511
|
+
"unused-import": eslint.Rule.RuleModule;
|
|
1512
|
+
"fixme-tag": eslint.Rule.RuleModule;
|
|
1513
|
+
"todo-tag": eslint.Rule.RuleModule;
|
|
1514
|
+
"useless-string-operation": eslint.Rule.RuleModule;
|
|
1515
|
+
"no-unused-function-argument": eslint.Rule.RuleModule;
|
|
1516
|
+
"no-duplicate-string": eslint.Rule.RuleModule;
|
|
1517
|
+
"no-case-label-in-switch": eslint.Rule.RuleModule;
|
|
1518
|
+
"no-parameter-reassignment": eslint.Rule.RuleModule;
|
|
1519
|
+
"prefer-while": eslint.Rule.RuleModule;
|
|
1520
|
+
"no-sonar-comments": eslint.Rule.RuleModule;
|
|
1521
|
+
"no-small-switch": eslint.Rule.RuleModule;
|
|
1522
|
+
"no-hardcoded-ip": eslint.Rule.RuleModule;
|
|
1523
|
+
"label-position": eslint.Rule.RuleModule;
|
|
1524
|
+
"public-static-readonly": eslint.Rule.RuleModule;
|
|
1525
|
+
"file-header": eslint.Rule.RuleModule;
|
|
1526
|
+
"call-argument-line": eslint.Rule.RuleModule;
|
|
1527
|
+
"max-switch-cases": eslint.Rule.RuleModule;
|
|
1528
|
+
"no-unused-vars": eslint.Rule.RuleModule;
|
|
1529
|
+
"prefer-immediate-return": eslint.Rule.RuleModule;
|
|
1530
|
+
"function-inside-loop": eslint.Rule.RuleModule;
|
|
1531
|
+
"code-eval": eslint.Rule.RuleModule;
|
|
1532
|
+
"no-variable-usage-before-declaration": eslint.Rule.RuleModule;
|
|
1533
|
+
"future-reserved-words": eslint.Rule.RuleModule;
|
|
1534
|
+
"array-constructor": eslint.Rule.RuleModule;
|
|
1535
|
+
"bitwise-operators": eslint.Rule.RuleModule;
|
|
1536
|
+
"no-function-declaration-in-block": eslint.Rule.RuleModule;
|
|
1537
|
+
"no-primitive-wrappers": eslint.Rule.RuleModule;
|
|
1538
|
+
"for-in": eslint.Rule.RuleModule;
|
|
1539
|
+
"cyclomatic-complexity": eslint.Rule.RuleModule;
|
|
1540
|
+
"no-skipped-tests": eslint.Rule.RuleModule;
|
|
1541
|
+
"no-identical-expressions": eslint.Rule.RuleModule;
|
|
1542
|
+
"no-nested-switch": eslint.Rule.RuleModule;
|
|
1543
|
+
"constructor-for-side-effects": eslint.Rule.RuleModule;
|
|
1544
|
+
"no-dead-store": eslint.Rule.RuleModule;
|
|
1545
|
+
"no-identical-conditions": eslint.Rule.RuleModule;
|
|
1546
|
+
"no-duplicated-branches": eslint.Rule.RuleModule;
|
|
1547
|
+
deprecation: eslint.Rule.RuleModule;
|
|
1548
|
+
"no-inverted-boolean-check": eslint.Rule.RuleModule;
|
|
1549
|
+
"misplaced-loop-counter": eslint.Rule.RuleModule;
|
|
1550
|
+
"no-nested-functions": eslint.Rule.RuleModule;
|
|
1551
|
+
"no-hardcoded-passwords": eslint.Rule.RuleModule;
|
|
1552
|
+
"sql-queries": eslint.Rule.RuleModule;
|
|
1553
|
+
"insecure-cookie": eslint.Rule.RuleModule;
|
|
1554
|
+
"no-useless-increment": eslint.Rule.RuleModule;
|
|
1555
|
+
"no-globals-shadowing": eslint.Rule.RuleModule;
|
|
1556
|
+
"no-undefined-assignment": eslint.Rule.RuleModule;
|
|
1557
|
+
"no-empty-test-file": eslint.Rule.RuleModule;
|
|
1558
|
+
"no-ignored-return": eslint.Rule.RuleModule;
|
|
1559
|
+
"no-wildcard-import": eslint.Rule.RuleModule;
|
|
1560
|
+
"arguments-order": eslint.Rule.RuleModule;
|
|
1561
|
+
"pseudo-random": eslint.Rule.RuleModule;
|
|
1562
|
+
"for-loop-increment-sign": eslint.Rule.RuleModule;
|
|
1563
|
+
cookies: eslint.Rule.RuleModule;
|
|
1564
|
+
"null-dereference": eslint.Rule.RuleModule;
|
|
1565
|
+
"no-selector-parameter": eslint.Rule.RuleModule;
|
|
1566
|
+
"updated-loop-counter": eslint.Rule.RuleModule;
|
|
1567
|
+
"block-scoped-var": eslint.Rule.RuleModule;
|
|
1568
|
+
"no-built-in-override": eslint.Rule.RuleModule;
|
|
1569
|
+
"prefer-object-literal": eslint.Rule.RuleModule;
|
|
1570
|
+
"no-ignored-exceptions": eslint.Rule.RuleModule;
|
|
1571
|
+
"no-gratuitous-expressions": eslint.Rule.RuleModule;
|
|
1572
|
+
"file-uploads": eslint.Rule.RuleModule;
|
|
1573
|
+
"file-permissions": eslint.Rule.RuleModule;
|
|
1574
|
+
"no-empty-character-class": eslint.Rule.RuleModule;
|
|
1575
|
+
"no-unenclosed-multiline-block": eslint.Rule.RuleModule;
|
|
1576
|
+
"index-of-compare-to-positive-number": eslint.Rule.RuleModule;
|
|
1577
|
+
"assertions-in-tests": eslint.Rule.RuleModule;
|
|
1578
|
+
"no-implicit-global": eslint.Rule.RuleModule;
|
|
1579
|
+
"no-useless-catch": eslint.Rule.RuleModule;
|
|
1580
|
+
"xml-parser-xxe": eslint.Rule.RuleModule;
|
|
1581
|
+
"non-existent-operator": eslint.Rule.RuleModule;
|
|
1582
|
+
"web-sql-database": eslint.Rule.RuleModule;
|
|
1583
|
+
"post-message": eslint.Rule.RuleModule;
|
|
1584
|
+
"no-array-delete": eslint.Rule.RuleModule;
|
|
1585
|
+
"no-alphabetical-sort": eslint.Rule.RuleModule;
|
|
1586
|
+
"no-incomplete-assertions": eslint.Rule.RuleModule;
|
|
1587
|
+
"no-global-this": eslint.Rule.RuleModule;
|
|
1588
|
+
"new-operator-misuse": eslint.Rule.RuleModule;
|
|
1589
|
+
"no-delete-var": eslint.Rule.RuleModule;
|
|
1590
|
+
"strings-comparison": eslint.Rule.RuleModule;
|
|
1591
|
+
"file-name-differ-from-class": eslint.Rule.RuleModule;
|
|
1592
|
+
"cookie-no-httponly": eslint.Rule.RuleModule;
|
|
1593
|
+
"no-nested-conditional": eslint.Rule.RuleModule;
|
|
1594
|
+
"no-incorrect-string-concat": eslint.Rule.RuleModule;
|
|
1595
|
+
"different-types-comparison": eslint.Rule.RuleModule;
|
|
1596
|
+
"inverted-assertion-arguments": eslint.Rule.RuleModule;
|
|
1597
|
+
"shorthand-property-grouping": eslint.Rule.RuleModule;
|
|
1598
|
+
"updated-const-var": eslint.Rule.RuleModule;
|
|
1599
|
+
"arguments-usage": eslint.Rule.RuleModule;
|
|
1600
|
+
"destructuring-assignment-syntax": eslint.Rule.RuleModule;
|
|
1601
|
+
"no-invariant-returns": eslint.Rule.RuleModule;
|
|
1602
|
+
"arrow-function-convention": eslint.Rule.RuleModule;
|
|
1603
|
+
"class-prototype": eslint.Rule.RuleModule;
|
|
1604
|
+
"generator-without-yield": eslint.Rule.RuleModule;
|
|
1605
|
+
"no-require-or-define": eslint.Rule.RuleModule;
|
|
1606
|
+
"no-associative-arrays": eslint.Rule.RuleModule;
|
|
1607
|
+
"comma-or-logical-or-case": eslint.Rule.RuleModule;
|
|
1608
|
+
"no-redundant-jump": eslint.Rule.RuleModule;
|
|
1609
|
+
"inconsistent-function-call": eslint.Rule.RuleModule;
|
|
1610
|
+
"no-use-of-empty-return-value": eslint.Rule.RuleModule;
|
|
1611
|
+
"enforce-trailing-comma": {
|
|
1612
|
+
meta: _eslint_core.RulesMeta<string, unknown[], unknown>;
|
|
1613
|
+
create(context: eslint.Rule.RuleContext): eslint.Rule.NodeListener;
|
|
1614
|
+
};
|
|
1615
|
+
"void-use": eslint.Rule.RuleModule;
|
|
1616
|
+
"operation-returning-nan": eslint.Rule.RuleModule;
|
|
1617
|
+
"values-not-convertible-to-numbers": eslint.Rule.RuleModule;
|
|
1618
|
+
"non-number-in-arithmetic-expression": eslint.Rule.RuleModule;
|
|
1619
|
+
"cognitive-complexity": eslint.Rule.RuleModule;
|
|
1620
|
+
"argument-type": eslint.Rule.RuleModule;
|
|
1621
|
+
"in-operator-type-error": eslint.Rule.RuleModule;
|
|
1622
|
+
"array-callback-without-return": eslint.Rule.RuleModule;
|
|
1623
|
+
"declarations-in-global-scope": eslint.Rule.RuleModule;
|
|
1624
|
+
"function-return-type": eslint.Rule.RuleModule;
|
|
1625
|
+
"no-inconsistent-returns": eslint.Rule.RuleModule;
|
|
1626
|
+
"no-reference-error": eslint.Rule.RuleModule;
|
|
1627
|
+
"super-invocation": eslint.Rule.RuleModule;
|
|
1628
|
+
"no-all-duplicated-branches": eslint.Rule.RuleModule;
|
|
1629
|
+
"no-same-line-conditional": eslint.Rule.RuleModule;
|
|
1630
|
+
"conditional-indentation": eslint.Rule.RuleModule;
|
|
1631
|
+
"no-collection-size-mischeck": eslint.Rule.RuleModule;
|
|
1632
|
+
"no-unthrown-error": eslint.Rule.RuleModule;
|
|
1633
|
+
"no-unused-collection": eslint.Rule.RuleModule;
|
|
1634
|
+
"no-os-command-from-path": eslint.Rule.RuleModule;
|
|
1635
|
+
"no-misleading-array-reverse": eslint.Rule.RuleModule;
|
|
1636
|
+
"no-for-in-iterable": eslint.Rule.RuleModule;
|
|
1637
|
+
"no-element-overwrite": eslint.Rule.RuleModule;
|
|
1638
|
+
"no-identical-functions": eslint.Rule.RuleModule;
|
|
1639
|
+
"no-empty-collection": eslint.Rule.RuleModule;
|
|
1640
|
+
"no-redundant-assignments": eslint.Rule.RuleModule;
|
|
1641
|
+
"prefer-type-guard": eslint.Rule.RuleModule;
|
|
1642
|
+
"use-type-alias": eslint.Rule.RuleModule;
|
|
1643
|
+
"no-return-type-any": eslint.Rule.RuleModule;
|
|
1644
|
+
"no-implicit-dependencies": eslint.Rule.RuleModule;
|
|
1645
|
+
"no-useless-intersection": eslint.Rule.RuleModule;
|
|
1646
|
+
"weak-ssl": eslint.Rule.RuleModule;
|
|
1647
|
+
"no-weak-keys": eslint.Rule.RuleModule;
|
|
1648
|
+
csrf: eslint.Rule.RuleModule;
|
|
1649
|
+
"production-debug": eslint.Rule.RuleModule;
|
|
1650
|
+
"prefer-default-last": eslint.Rule.RuleModule;
|
|
1651
|
+
"no-in-misuse": eslint.Rule.RuleModule;
|
|
1652
|
+
"no-duplicate-in-composite": eslint.Rule.RuleModule;
|
|
1653
|
+
"max-union-size": eslint.Rule.RuleModule;
|
|
1654
|
+
"no-undefined-argument": eslint.Rule.RuleModule;
|
|
1655
|
+
"no-nested-template-literals": eslint.Rule.RuleModule;
|
|
1656
|
+
"prefer-promise-shorthand": eslint.Rule.RuleModule;
|
|
1657
|
+
"os-command": eslint.Rule.RuleModule;
|
|
1658
|
+
"no-redundant-optional": eslint.Rule.RuleModule;
|
|
1659
|
+
"regular-expr": eslint.Rule.RuleModule;
|
|
1660
|
+
encryption: eslint.Rule.RuleModule;
|
|
1661
|
+
hashing: eslint.Rule.RuleModule;
|
|
1662
|
+
"bool-param-default": eslint.Rule.RuleModule;
|
|
1663
|
+
xpath: eslint.Rule.RuleModule;
|
|
1664
|
+
sockets: eslint.Rule.RuleModule;
|
|
1665
|
+
"no-try-promise": eslint.Rule.RuleModule;
|
|
1666
|
+
"process-argv": eslint.Rule.RuleModule;
|
|
1667
|
+
"standard-input": eslint.Rule.RuleModule;
|
|
1668
|
+
"unverified-certificate": eslint.Rule.RuleModule;
|
|
1669
|
+
"no-unsafe-unzip": eslint.Rule.RuleModule;
|
|
1670
|
+
cors: eslint.Rule.RuleModule;
|
|
1671
|
+
"link-with-target-blank": eslint.Rule.RuleModule;
|
|
1672
|
+
"disabled-auto-escaping": eslint.Rule.RuleModule;
|
|
1673
|
+
"table-header": eslint.Rule.RuleModule;
|
|
1674
|
+
"no-table-as-layout": eslint.Rule.RuleModule;
|
|
1675
|
+
"table-header-reference": eslint.Rule.RuleModule;
|
|
1676
|
+
"object-alt-content": eslint.Rule.RuleModule;
|
|
1677
|
+
"no-clear-text-protocols": eslint.Rule.RuleModule;
|
|
1678
|
+
"publicly-writable-directories": eslint.Rule.RuleModule;
|
|
1679
|
+
"unverified-hostname": eslint.Rule.RuleModule;
|
|
1680
|
+
"encryption-secure-mode": eslint.Rule.RuleModule;
|
|
1681
|
+
"no-weak-cipher": eslint.Rule.RuleModule;
|
|
1682
|
+
"no-intrusive-permissions": eslint.Rule.RuleModule;
|
|
1683
|
+
"insecure-jwt-token": eslint.Rule.RuleModule;
|
|
1684
|
+
"x-powered-by": eslint.Rule.RuleModule;
|
|
1685
|
+
"hidden-files": eslint.Rule.RuleModule;
|
|
1686
|
+
"content-length": eslint.Rule.RuleModule;
|
|
1687
|
+
"disabled-resource-integrity": eslint.Rule.RuleModule;
|
|
1688
|
+
"content-security-policy": eslint.Rule.RuleModule;
|
|
1689
|
+
"no-mixed-content": eslint.Rule.RuleModule;
|
|
1690
|
+
"frame-ancestors": eslint.Rule.RuleModule;
|
|
1691
|
+
"no-mime-sniff": eslint.Rule.RuleModule;
|
|
1692
|
+
"no-referrer-policy": eslint.Rule.RuleModule;
|
|
1693
|
+
"strict-transport-security": eslint.Rule.RuleModule;
|
|
1694
|
+
"certificate-transparency": eslint.Rule.RuleModule;
|
|
1695
|
+
"dns-prefetching": eslint.Rule.RuleModule;
|
|
1696
|
+
"confidential-information-logging": eslint.Rule.RuleModule;
|
|
1697
|
+
"no-ip-forward": eslint.Rule.RuleModule;
|
|
1698
|
+
"empty-string-repetition": eslint.Rule.RuleModule;
|
|
1699
|
+
"regex-complexity": eslint.Rule.RuleModule;
|
|
1700
|
+
"anchor-precedence": eslint.Rule.RuleModule;
|
|
1701
|
+
"slow-regex": eslint.Rule.RuleModule;
|
|
1702
|
+
"no-invalid-regexp": eslint.Rule.RuleModule;
|
|
1703
|
+
"unused-named-groups": eslint.Rule.RuleModule;
|
|
1704
|
+
"no-same-argument-assert": eslint.Rule.RuleModule;
|
|
1705
|
+
"unicode-aware-regex": eslint.Rule.RuleModule;
|
|
1706
|
+
"no-misleading-character-class": eslint.Rule.RuleModule;
|
|
1707
|
+
"duplicates-in-character-class": eslint.Rule.RuleModule;
|
|
1708
|
+
"session-regeneration": eslint.Rule.RuleModule;
|
|
1709
|
+
"test-check-exception": eslint.Rule.RuleModule;
|
|
1710
|
+
"stable-tests": eslint.Rule.RuleModule;
|
|
1711
|
+
"no-empty-after-reluctant": eslint.Rule.RuleModule;
|
|
1712
|
+
"single-character-alternation": eslint.Rule.RuleModule;
|
|
1713
|
+
"no-code-after-done": eslint.Rule.RuleModule;
|
|
1714
|
+
"disabled-timeout": eslint.Rule.RuleModule;
|
|
1715
|
+
"chai-determinate-assertion": eslint.Rule.RuleModule;
|
|
1716
|
+
"aws-s3-bucket-server-encryption": eslint.Rule.RuleModule;
|
|
1717
|
+
"aws-s3-bucket-insecure-http": eslint.Rule.RuleModule;
|
|
1718
|
+
"aws-s3-bucket-versioning": eslint.Rule.RuleModule;
|
|
1719
|
+
"aws-s3-bucket-granted-access": eslint.Rule.RuleModule;
|
|
1720
|
+
"no-angular-bypass-sanitization": eslint.Rule.RuleModule;
|
|
1721
|
+
"aws-iam-public-access": eslint.Rule.RuleModule;
|
|
1722
|
+
"aws-ec2-unencrypted-ebs-volume": eslint.Rule.RuleModule;
|
|
1723
|
+
"aws-s3-bucket-public-access": eslint.Rule.RuleModule;
|
|
1724
|
+
"no-vue-bypass-sanitization": eslint.Rule.RuleModule;
|
|
1725
|
+
"aws-iam-all-privileges": eslint.Rule.RuleModule;
|
|
1726
|
+
"aws-rds-unencrypted-databases": eslint.Rule.RuleModule;
|
|
1727
|
+
"aws-iam-all-resources-accessible": eslint.Rule.RuleModule;
|
|
1728
|
+
"aws-opensearchservice-domain": eslint.Rule.RuleModule;
|
|
1729
|
+
"aws-iam-privilege-escalation": eslint.Rule.RuleModule;
|
|
1730
|
+
"aws-sagemaker-unencrypted-notebook": eslint.Rule.RuleModule;
|
|
1731
|
+
"aws-restricted-ip-admin-access": eslint.Rule.RuleModule;
|
|
1732
|
+
"no-empty-alternatives": eslint.Rule.RuleModule;
|
|
1733
|
+
"no-control-regex": eslint.Rule.RuleModule;
|
|
1734
|
+
"no-regex-spaces": eslint.Rule.RuleModule;
|
|
1735
|
+
"aws-sns-unencrypted-topics": eslint.Rule.RuleModule;
|
|
1736
|
+
"existing-groups": eslint.Rule.RuleModule;
|
|
1737
|
+
"aws-ec2-rds-dms-public": eslint.Rule.RuleModule;
|
|
1738
|
+
"aws-sqs-unencrypted-queue": eslint.Rule.RuleModule;
|
|
1739
|
+
"no-empty-group": eslint.Rule.RuleModule;
|
|
1740
|
+
"aws-efs-unencrypted": eslint.Rule.RuleModule;
|
|
1741
|
+
"aws-apigateway-public-api": eslint.Rule.RuleModule;
|
|
1742
|
+
"stateful-regex": eslint.Rule.RuleModule;
|
|
1743
|
+
"concise-regex": eslint.Rule.RuleModule;
|
|
1744
|
+
"single-char-in-character-classes": eslint.Rule.RuleModule;
|
|
1745
|
+
"no-hardcoded-secrets": eslint.Rule.RuleModule;
|
|
1746
|
+
"no-exclusive-tests": eslint.Rule.RuleModule;
|
|
1747
|
+
"jsx-no-leaked-render": eslint.Rule.RuleModule;
|
|
1748
|
+
"no-hook-setter-in-body": eslint.Rule.RuleModule;
|
|
1749
|
+
"no-useless-react-setstate": eslint.Rule.RuleModule;
|
|
1750
|
+
"no-uniq-key": eslint.Rule.RuleModule;
|
|
1751
|
+
"redundant-type-aliases": eslint.Rule.RuleModule;
|
|
1752
|
+
"prefer-regexp-exec": eslint.Rule.RuleModule;
|
|
1753
|
+
"no-internal-api-use": eslint.Rule.RuleModule;
|
|
1754
|
+
"prefer-read-only-props": eslint.Rule.RuleModule;
|
|
1755
|
+
"no-literal-call": eslint.Rule.RuleModule;
|
|
1756
|
+
"reduce-initial-value": eslint.Rule.RuleModule;
|
|
1757
|
+
"no-async-constructor": eslint.Rule.RuleModule;
|
|
1758
|
+
};
|
|
1759
|
+
configs: {
|
|
1760
|
+
recommended: eslint.Linter.FlatConfig<eslint.Linter.RulesRecord>;
|
|
1761
|
+
"recommended-legacy": eslint.Linter.LegacyConfig<eslint.Linter.RulesRecord, eslint.Linter.RulesRecord>;
|
|
1762
|
+
};
|
|
1763
|
+
meta: {
|
|
1764
|
+
name: string;
|
|
1765
|
+
version: string;
|
|
1766
|
+
};
|
|
1767
|
+
};
|
|
1768
|
+
};
|
|
1769
|
+
rules: {
|
|
1770
|
+
"unicorn/prefer-node-protocol": string;
|
|
1771
|
+
"unicorn/no-useless-undefined": string;
|
|
1772
|
+
"unicorn/no-lonely-if": string;
|
|
1773
|
+
"unicorn/prefer-optional-catch-binding": string;
|
|
1774
|
+
"unicorn/prefer-string-replace-all": string;
|
|
1775
|
+
"unicorn/prevent-abbreviations": (string | {
|
|
1776
|
+
allowList: {
|
|
1777
|
+
Props: boolean;
|
|
1778
|
+
props: boolean;
|
|
1779
|
+
Ref: boolean;
|
|
1780
|
+
ref: boolean;
|
|
1781
|
+
Src: boolean;
|
|
1782
|
+
src: boolean;
|
|
1783
|
+
Params: boolean;
|
|
1784
|
+
params: boolean;
|
|
1785
|
+
Env: boolean;
|
|
1786
|
+
env: boolean;
|
|
1787
|
+
Args: boolean;
|
|
1788
|
+
args: boolean;
|
|
1789
|
+
Docs: boolean;
|
|
1790
|
+
docs: boolean;
|
|
1791
|
+
arg: boolean;
|
|
1792
|
+
err: boolean;
|
|
1793
|
+
req: boolean;
|
|
1794
|
+
res: boolean;
|
|
1795
|
+
ctx: boolean;
|
|
1796
|
+
val: boolean;
|
|
1797
|
+
};
|
|
1798
|
+
})[];
|
|
1799
|
+
"consistent-return": string;
|
|
1800
|
+
"no-implicit-coercion": string;
|
|
1801
|
+
"sonarjs/cognitive-complexity": (string | number)[];
|
|
1802
|
+
"sonarjs/no-identical-functions": string;
|
|
1803
|
+
"sonarjs/no-duplicated-branches": string;
|
|
1804
|
+
"sonarjs/no-redundant-boolean": string;
|
|
1805
|
+
"sonarjs/no-inverted-boolean-check": string;
|
|
1806
|
+
};
|
|
1807
|
+
} | {
|
|
1808
|
+
files: string[];
|
|
1809
|
+
plugins: {
|
|
1810
|
+
security: typescript_eslint.FlatConfig.Plugin;
|
|
1811
|
+
regexp: typeof eslint_plugin_regexp;
|
|
1812
|
+
};
|
|
1813
|
+
rules: {
|
|
1814
|
+
"security/detect-object-injection": string;
|
|
1815
|
+
"security/detect-unsafe-regex": string;
|
|
1816
|
+
"regexp/no-super-linear-backtracking": string;
|
|
1817
|
+
"regexp/no-useless-escape": string;
|
|
1818
|
+
"regexp/no-empty-capturing-group": string;
|
|
1819
|
+
};
|
|
1820
|
+
} | {
|
|
1821
|
+
files: string[];
|
|
1822
|
+
rules: {
|
|
1823
|
+
"max-lines": (string | {
|
|
1824
|
+
max: number;
|
|
1825
|
+
skipBlankLines: boolean;
|
|
1826
|
+
skipComments: boolean;
|
|
1827
|
+
})[];
|
|
1828
|
+
"max-lines-per-function": (string | {
|
|
1829
|
+
max: number;
|
|
1830
|
+
skipBlankLines: boolean;
|
|
1831
|
+
skipComments: boolean;
|
|
1832
|
+
})[];
|
|
1833
|
+
complexity: (string | number)[];
|
|
1834
|
+
"max-params": (string | number)[];
|
|
1835
|
+
"max-depth": (string | number)[];
|
|
1836
|
+
"no-var": string;
|
|
1837
|
+
"prefer-const": string;
|
|
1838
|
+
};
|
|
1839
|
+
} | {
|
|
1840
|
+
files: string[];
|
|
1841
|
+
plugins: {
|
|
1842
|
+
"@typescript-eslint": CompatiblePlugin;
|
|
1843
|
+
};
|
|
1844
|
+
languageOptions: {
|
|
1845
|
+
parserOptions: {
|
|
1846
|
+
project: string | string[];
|
|
1847
|
+
tsconfigRootDir: string | undefined;
|
|
1848
|
+
};
|
|
1849
|
+
};
|
|
1850
|
+
rules: {
|
|
1851
|
+
"@typescript-eslint/require-await": string;
|
|
1852
|
+
"@typescript-eslint/no-floating-promises": string;
|
|
1853
|
+
"@typescript-eslint/no-misused-promises": string;
|
|
1854
|
+
"@typescript-eslint/await-thenable": string;
|
|
1855
|
+
"@typescript-eslint/no-unnecessary-condition": string;
|
|
1856
|
+
"@typescript-eslint/no-unnecessary-type-assertion": string;
|
|
1857
|
+
"@typescript-eslint/restrict-template-expressions": string;
|
|
1858
|
+
"@typescript-eslint/prefer-nullish-coalescing": string;
|
|
1859
|
+
"@typescript-eslint/prefer-optional-chain": string;
|
|
1860
|
+
"@typescript-eslint/switch-exhaustiveness-check": string;
|
|
1861
|
+
"@typescript-eslint/no-deprecated": string;
|
|
1862
|
+
"@typescript-eslint/consistent-type-exports": string;
|
|
1863
|
+
};
|
|
1864
|
+
} | {
|
|
1865
|
+
files: string[];
|
|
1866
|
+
name?: string;
|
|
1867
|
+
rules?: object;
|
|
1868
|
+
})[];
|
|
56
1869
|
|
|
57
|
-
|
|
1870
|
+
type TypescriptSecurityOptions = {
|
|
58
1871
|
files?: string[];
|
|
59
|
-
}
|
|
1872
|
+
};
|
|
60
1873
|
|
|
61
|
-
|
|
1874
|
+
type TypescriptSizeComplexityOptions = {
|
|
62
1875
|
files?: string[];
|
|
63
|
-
}
|
|
64
|
-
declare function typescriptSizeComplexity(options?: TypescriptSizeComplexityOptions):
|
|
1876
|
+
};
|
|
1877
|
+
declare function typescriptSizeComplexity(options?: TypescriptSizeComplexityOptions): {
|
|
1878
|
+
files: string[];
|
|
1879
|
+
rules: {
|
|
1880
|
+
"max-lines": (string | {
|
|
1881
|
+
max: number;
|
|
1882
|
+
skipBlankLines: boolean;
|
|
1883
|
+
skipComments: boolean;
|
|
1884
|
+
})[];
|
|
1885
|
+
"max-lines-per-function": (string | {
|
|
1886
|
+
max: number;
|
|
1887
|
+
skipBlankLines: boolean;
|
|
1888
|
+
skipComments: boolean;
|
|
1889
|
+
})[];
|
|
1890
|
+
complexity: (string | number)[];
|
|
1891
|
+
"max-params": (string | number)[];
|
|
1892
|
+
"max-depth": (string | number)[];
|
|
1893
|
+
"no-var": string;
|
|
1894
|
+
"prefer-const": string;
|
|
1895
|
+
};
|
|
1896
|
+
}[];
|
|
65
1897
|
|
|
66
1898
|
/**
|
|
67
1899
|
* Placeholder for future custom rules.
|