@typescript-eslint/utils 7.0.0-alpha.0 → 7.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.
- package/dist/ast-utils/helpers.d.ts +39 -15
- package/dist/ast-utils/helpers.d.ts.map +1 -1
- package/dist/ast-utils/predicates.d.ts +1 -1
- package/dist/ast-utils/predicates.d.ts.map +1 -1
- package/dist/eslint-utils/InferTypesFromRule.d.ts.map +1 -1
- package/dist/eslint-utils/RuleCreator.d.ts +1 -1
- package/dist/eslint-utils/RuleCreator.d.ts.map +1 -1
- package/dist/eslint-utils/RuleCreator.js.map +1 -1
- package/dist/eslint-utils/applyDefault.js.map +1 -1
- package/dist/eslint-utils/context.d.ts +16 -0
- package/dist/eslint-utils/context.d.ts.map +1 -0
- package/dist/eslint-utils/context.js +34 -0
- package/dist/eslint-utils/context.js.map +1 -0
- package/dist/eslint-utils/deepMerge.js +1 -1
- package/dist/eslint-utils/deepMerge.js.map +1 -1
- package/dist/eslint-utils/getParserServices.d.ts.map +1 -1
- package/dist/eslint-utils/getParserServices.js +18 -7
- package/dist/eslint-utils/getParserServices.js.map +1 -1
- package/dist/eslint-utils/nullThrows.d.ts +1 -1
- package/dist/eslint-utils/nullThrows.d.ts.map +1 -1
- package/dist/eslint-utils/nullThrows.js.map +1 -1
- package/dist/eslint-utils/parserPathSeemsToBeTSESLint.d.ts +2 -0
- package/dist/eslint-utils/parserPathSeemsToBeTSESLint.d.ts.map +1 -0
- package/dist/eslint-utils/parserPathSeemsToBeTSESLint.js +8 -0
- package/dist/eslint-utils/parserPathSeemsToBeTSESLint.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/json-schema.d.ts +15 -19
- package/dist/json-schema.d.ts.map +1 -1
- package/dist/ts-eslint/Config.d.ts +258 -0
- package/dist/ts-eslint/Config.d.ts.map +1 -0
- package/dist/ts-eslint/Config.js +4 -0
- package/dist/ts-eslint/Config.js.map +1 -0
- package/dist/ts-eslint/ESLint.d.ts +9 -14
- package/dist/ts-eslint/ESLint.d.ts.map +1 -1
- package/dist/ts-eslint/ESLint.js +1 -10
- package/dist/ts-eslint/ESLint.js.map +1 -1
- package/dist/ts-eslint/Linter.d.ts +50 -130
- package/dist/ts-eslint/Linter.d.ts.map +1 -1
- package/dist/ts-eslint/Linter.js.map +1 -1
- package/dist/ts-eslint/Parser.d.ts +89 -0
- package/dist/ts-eslint/Parser.d.ts.map +1 -0
- package/dist/ts-eslint/Parser.js +4 -0
- package/dist/ts-eslint/Parser.js.map +1 -0
- package/dist/ts-eslint/Processor.d.ts +37 -0
- package/dist/ts-eslint/Processor.d.ts.map +1 -0
- package/dist/ts-eslint/Processor.js +4 -0
- package/dist/ts-eslint/Processor.js.map +1 -0
- package/dist/ts-eslint/Rule.d.ts +120 -12
- package/dist/ts-eslint/Rule.d.ts.map +1 -1
- package/dist/ts-eslint/RuleTester.d.ts +4 -5
- package/dist/ts-eslint/RuleTester.d.ts.map +1 -1
- package/dist/ts-eslint/RuleTester.js.map +1 -1
- package/dist/ts-eslint/SourceCode.d.ts +29 -18
- package/dist/ts-eslint/SourceCode.d.ts.map +1 -1
- package/dist/ts-eslint/SourceCode.js.map +1 -1
- package/dist/ts-eslint/index.d.ts +3 -1
- package/dist/ts-eslint/index.d.ts.map +1 -1
- package/dist/ts-eslint/index.js +3 -1
- package/dist/ts-eslint/index.js.map +1 -1
- package/dist/ts-utils/index.d.ts +2 -0
- package/dist/ts-utils/index.d.ts.map +1 -0
- package/dist/ts-utils/index.js +18 -0
- package/dist/ts-utils/index.js.map +1 -0
- package/dist/ts-utils/isArray.d.ts +2 -0
- package/dist/ts-utils/isArray.d.ts.map +1 -0
- package/dist/ts-utils/isArray.js +9 -0
- package/dist/ts-utils/isArray.js.map +1 -0
- package/package.json +16 -14
- package/dist/ts-eslint/CLIEngine.d.ts +0 -137
- package/dist/ts-eslint/CLIEngine.d.ts.map +0 -1
- package/dist/ts-eslint/CLIEngine.js +0 -18
- package/dist/ts-eslint/CLIEngine.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
1
|
+
import type { ClassicConfig, FlatConfig, SharedConfig } from './Config';
|
|
2
|
+
import type { Parser } from './Parser';
|
|
3
|
+
import type { Processor as ProcessorType } from './Processor';
|
|
4
|
+
import type { AnyRuleCreateFunction, AnyRuleModule, RuleCreateFunction, RuleFix, RuleModule } from './Rule';
|
|
5
5
|
import type { SourceCode } from './SourceCode';
|
|
6
6
|
export type MinimalRuleModule<TMessageIds extends string = string, TOptions extends readonly unknown[] = []> = Partial<Omit<RuleModule<TMessageIds, TOptions>, 'create'>> & Pick<RuleModule<TMessageIds, TOptions>, 'create'>;
|
|
7
7
|
declare class LinterBase {
|
|
@@ -15,7 +15,7 @@ declare class LinterBase {
|
|
|
15
15
|
* @param parserId Name of the parser
|
|
16
16
|
* @param parserModule The parser object
|
|
17
17
|
*/
|
|
18
|
-
defineParser(parserId: string, parserModule:
|
|
18
|
+
defineParser(parserId: string, parserModule: Parser.LooseParserModule): void;
|
|
19
19
|
/**
|
|
20
20
|
* Defines a new linting rule.
|
|
21
21
|
* @param ruleId A unique rule identifier
|
|
@@ -46,7 +46,7 @@ declare class LinterBase {
|
|
|
46
46
|
* If this is an object, then it has "filename", "allowInlineConfig", and some properties.
|
|
47
47
|
* @returns The results as an array of messages or an empty array if no messages.
|
|
48
48
|
*/
|
|
49
|
-
verify(textOrSourceCode: SourceCode | string, config: Linter.
|
|
49
|
+
verify(textOrSourceCode: SourceCode | string, config: Linter.ConfigType, filenameOrOptions?: Linter.VerifyOptions | string): Linter.LintMessage[];
|
|
50
50
|
/**
|
|
51
51
|
* Performs multiple autofix passes over the text until as many fixes as possible have been applied.
|
|
52
52
|
* @param code The source text to apply fixes to.
|
|
@@ -54,7 +54,7 @@ declare class LinterBase {
|
|
|
54
54
|
* @param options The ESLint options object to use.
|
|
55
55
|
* @returns The result of the fix operation as returned from the SourceCodeFixer.
|
|
56
56
|
*/
|
|
57
|
-
verifyAndFix(code: string, config: Linter.
|
|
57
|
+
verifyAndFix(code: string, config: Linter.ConfigType, options: Linter.FixOptions): Linter.FixReport;
|
|
58
58
|
/**
|
|
59
59
|
* The version from package.json.
|
|
60
60
|
*/
|
|
@@ -65,93 +65,30 @@ declare class LinterBase {
|
|
|
65
65
|
static readonly version: string;
|
|
66
66
|
}
|
|
67
67
|
declare namespace Linter {
|
|
68
|
-
|
|
68
|
+
interface LinterOptions {
|
|
69
69
|
/**
|
|
70
70
|
* path to a directory that should be considered as the current working directory.
|
|
71
71
|
*/
|
|
72
72
|
cwd?: string;
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
*/
|
|
93
|
-
env?: EnvironmentConfig;
|
|
94
|
-
/**
|
|
95
|
-
* The path to other config files or the package name of shareable configs.
|
|
96
|
-
*/
|
|
97
|
-
extends?: string[] | string;
|
|
98
|
-
/**
|
|
99
|
-
* The global variable settings.
|
|
100
|
-
*/
|
|
101
|
-
globals?: GlobalsConfig;
|
|
102
|
-
/**
|
|
103
|
-
* The flag that disables directive comments.
|
|
104
|
-
*/
|
|
105
|
-
noInlineConfig?: boolean;
|
|
106
|
-
/**
|
|
107
|
-
* The override settings per kind of files.
|
|
108
|
-
*/
|
|
109
|
-
overrides?: ConfigOverride[];
|
|
110
|
-
/**
|
|
111
|
-
* The path to a parser or the package name of a parser.
|
|
112
|
-
*/
|
|
113
|
-
parser?: string;
|
|
114
|
-
/**
|
|
115
|
-
* The parser options.
|
|
116
|
-
*/
|
|
117
|
-
parserOptions?: ParserOptions;
|
|
118
|
-
/**
|
|
119
|
-
* The plugin specifiers.
|
|
120
|
-
*/
|
|
121
|
-
plugins?: string[];
|
|
122
|
-
/**
|
|
123
|
-
* The processor specifier.
|
|
124
|
-
*/
|
|
125
|
-
processor?: string;
|
|
126
|
-
/**
|
|
127
|
-
* The flag to report unused `eslint-disable` comments.
|
|
128
|
-
*/
|
|
129
|
-
reportUnusedDisableDirectives?: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* The rule settings.
|
|
132
|
-
*/
|
|
133
|
-
rules?: RulesRecord;
|
|
134
|
-
/**
|
|
135
|
-
* The shared settings.
|
|
136
|
-
*/
|
|
137
|
-
settings?: SharedConfigurationSettings;
|
|
138
|
-
}
|
|
139
|
-
export interface ConfigOverride extends BaseConfig {
|
|
140
|
-
excludedFiles?: string[] | string;
|
|
141
|
-
files: string[] | string;
|
|
142
|
-
}
|
|
143
|
-
export interface Config extends BaseConfig {
|
|
144
|
-
/**
|
|
145
|
-
* The glob patterns that ignore to lint.
|
|
146
|
-
*/
|
|
147
|
-
ignorePatterns?: string[] | string;
|
|
148
|
-
/**
|
|
149
|
-
* The root flag.
|
|
150
|
-
*/
|
|
151
|
-
root?: boolean;
|
|
152
|
-
}
|
|
153
|
-
export type ParserOptions = TSParserOptions;
|
|
154
|
-
export interface VerifyOptions {
|
|
74
|
+
type EnvironmentConfig = SharedConfig.EnvironmentConfig;
|
|
75
|
+
type GlobalsConfig = SharedConfig.GlobalsConfig;
|
|
76
|
+
type GlobalVariableOption = SharedConfig.GlobalVariableOption;
|
|
77
|
+
type GlobalVariableOptionBase = SharedConfig.GlobalVariableOptionBase;
|
|
78
|
+
type ParserOptions = SharedConfig.ParserOptions;
|
|
79
|
+
type PluginMeta = SharedConfig.PluginMeta;
|
|
80
|
+
type RuleEntry = SharedConfig.RuleEntry;
|
|
81
|
+
type RuleLevel = SharedConfig.RuleLevel;
|
|
82
|
+
type RuleLevelAndOptions = SharedConfig.RuleLevelAndOptions;
|
|
83
|
+
type RulesRecord = SharedConfig.RulesRecord;
|
|
84
|
+
type Severity = SharedConfig.Severity;
|
|
85
|
+
type SeverityString = SharedConfig.SeverityString;
|
|
86
|
+
/** @deprecated use Linter.ConfigType instead */
|
|
87
|
+
type Config = ClassicConfig.Config;
|
|
88
|
+
type ConfigType = ClassicConfig.Config | FlatConfig.ConfigArray;
|
|
89
|
+
/** @deprecated use ClassicConfig.ConfigOverride instead */
|
|
90
|
+
type ConfigOverride = ClassicConfig.ConfigOverride;
|
|
91
|
+
interface VerifyOptions {
|
|
155
92
|
/**
|
|
156
93
|
* Allow/disallow inline comments' ability to change config once it is set. Defaults to true if not supplied.
|
|
157
94
|
* Useful if you want to validate JS without comments overriding rules.
|
|
@@ -176,29 +113,29 @@ declare namespace Linter {
|
|
|
176
113
|
* the messages as appropriate, and return a one-dimensional array of
|
|
177
114
|
* messages.
|
|
178
115
|
*/
|
|
179
|
-
postprocess?:
|
|
116
|
+
postprocess?: ProcessorType.PostProcess;
|
|
180
117
|
/**
|
|
181
118
|
* preprocessor for source text.
|
|
182
119
|
* If provided, this should accept a string of source text, and return an array of code blocks to lint.
|
|
183
120
|
*/
|
|
184
|
-
preprocess?:
|
|
121
|
+
preprocess?: ProcessorType.PreProcess;
|
|
185
122
|
/**
|
|
186
123
|
* Adds reported errors for unused `eslint-disable` directives.
|
|
187
124
|
*/
|
|
188
125
|
reportUnusedDisableDirectives?: SeverityString | boolean;
|
|
189
126
|
}
|
|
190
|
-
|
|
127
|
+
interface FixOptions extends VerifyOptions {
|
|
191
128
|
/**
|
|
192
129
|
* Determines whether fixes should be applied.
|
|
193
130
|
*/
|
|
194
131
|
fix?: boolean;
|
|
195
132
|
}
|
|
196
|
-
|
|
133
|
+
interface LintSuggestion {
|
|
197
134
|
desc: string;
|
|
198
135
|
fix: RuleFix;
|
|
199
136
|
messageId?: string;
|
|
200
137
|
}
|
|
201
|
-
|
|
138
|
+
interface LintMessage {
|
|
202
139
|
/**
|
|
203
140
|
* The 1-based column number.
|
|
204
141
|
*/
|
|
@@ -243,7 +180,7 @@ declare namespace Linter {
|
|
|
243
180
|
*/
|
|
244
181
|
suggestions?: LintSuggestion[];
|
|
245
182
|
}
|
|
246
|
-
|
|
183
|
+
interface FixReport {
|
|
247
184
|
/**
|
|
248
185
|
* True, if the code was fixed
|
|
249
186
|
*/
|
|
@@ -257,63 +194,46 @@ declare namespace Linter {
|
|
|
257
194
|
*/
|
|
258
195
|
messages: LintMessage[];
|
|
259
196
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
services?: ParserServices;
|
|
268
|
-
scopeManager?: Scope.ScopeManager;
|
|
269
|
-
visitorKeys?: SourceCode.VisitorKeys;
|
|
270
|
-
}
|
|
271
|
-
export interface Processor {
|
|
272
|
-
/**
|
|
273
|
-
* The function to extract code blocks.
|
|
274
|
-
*/
|
|
275
|
-
preprocess?: (text: string, filename: string) => (string | {
|
|
276
|
-
text: string;
|
|
277
|
-
filename: string;
|
|
278
|
-
})[];
|
|
279
|
-
/**
|
|
280
|
-
* The function to merge messages.
|
|
281
|
-
*/
|
|
282
|
-
postprocess?: (messagesList: Linter.LintMessage[][], filename: string) => Linter.LintMessage[];
|
|
283
|
-
/**
|
|
284
|
-
* If `true` then it means the processor supports autofix.
|
|
285
|
-
*/
|
|
286
|
-
supportsAutofix?: boolean;
|
|
287
|
-
}
|
|
288
|
-
export interface Environment {
|
|
197
|
+
/** @deprecated use Parser.ParserModule */
|
|
198
|
+
type ParserModule = Parser.LooseParserModule;
|
|
199
|
+
/** @deprecated use Parser.ParseResult */
|
|
200
|
+
type ESLintParseResult = Parser.ParseResult;
|
|
201
|
+
/** @deprecated use Processor.ProcessorModule */
|
|
202
|
+
type Processor = ProcessorType.ProcessorModule;
|
|
203
|
+
interface Environment {
|
|
289
204
|
/**
|
|
290
205
|
* The definition of global variables.
|
|
291
206
|
*/
|
|
292
|
-
globals?:
|
|
207
|
+
globals?: GlobalsConfig;
|
|
293
208
|
/**
|
|
294
209
|
* The parser options that will be enabled under this environment.
|
|
295
210
|
*/
|
|
296
211
|
parserOptions?: ParserOptions;
|
|
297
212
|
}
|
|
298
|
-
|
|
213
|
+
type LegacyPluginRules = Record<string, AnyRuleCreateFunction | AnyRuleModule>;
|
|
214
|
+
type PluginRules = Record<string, AnyRuleModule>;
|
|
215
|
+
interface Plugin {
|
|
299
216
|
/**
|
|
300
217
|
* The definition of plugin configs.
|
|
301
218
|
*/
|
|
302
|
-
configs?: Record<string,
|
|
219
|
+
configs?: Record<string, ClassicConfig.Config>;
|
|
303
220
|
/**
|
|
304
221
|
* The definition of plugin environments.
|
|
305
222
|
*/
|
|
306
223
|
environments?: Record<string, Environment>;
|
|
224
|
+
/**
|
|
225
|
+
* Metadata about your plugin for easier debugging and more effective caching of plugins.
|
|
226
|
+
*/
|
|
227
|
+
meta?: PluginMeta;
|
|
307
228
|
/**
|
|
308
229
|
* The definition of plugin processors.
|
|
309
230
|
*/
|
|
310
|
-
processors?: Record<string,
|
|
231
|
+
processors?: Record<string, ProcessorType.ProcessorModule>;
|
|
311
232
|
/**
|
|
312
233
|
* The definition of plugin rules.
|
|
313
234
|
*/
|
|
314
|
-
rules?:
|
|
235
|
+
rules?: LegacyPluginRules;
|
|
315
236
|
}
|
|
316
|
-
export {};
|
|
317
237
|
}
|
|
318
238
|
declare const Linter_base: typeof LinterBase;
|
|
319
239
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Linter.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Linter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Linter.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Linter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAA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eAAe,CAAC,CAAC;QAC3D;;WAEG;QACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;KAC3B;CACF;;AAED;;;;GAIG;AACH,cAAM,MAAO,SAAQ,WAAmC;CAAG;AAE3D,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Linter.js","sourceRoot":"","sources":["../../src/ts-eslint/Linter.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,mCAAgD;
|
|
1
|
+
{"version":3,"file":"Linter.js","sourceRoot":"","sources":["../../src/ts-eslint/Linter.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,mCAAgD;AA4ShD;;;;GAIG;AACH,MAAM,MAAO,SAAS,eAAkC;CAAG;AAElD,wBAAM"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { ParserServices, TSESTree } from '../ts-estree';
|
|
2
|
+
import type { ParserOptions } from './ParserOptions';
|
|
3
|
+
import type { Scope } from './Scope';
|
|
4
|
+
export declare namespace Parser {
|
|
5
|
+
interface ParserMeta {
|
|
6
|
+
/**
|
|
7
|
+
* The unique name of the parser.
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* The a string identifying the version of the parser.
|
|
12
|
+
*/
|
|
13
|
+
version?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A loose definition of the ParserModule type for use with configs
|
|
17
|
+
* This type intended to relax validation of configs so that parsers that have
|
|
18
|
+
* different AST types or scope managers can still be passed to configs
|
|
19
|
+
*/
|
|
20
|
+
type LooseParserModule = {
|
|
21
|
+
/**
|
|
22
|
+
* Information about the parser to uniquely identify it when serializing.
|
|
23
|
+
*/
|
|
24
|
+
meta?: ParserMeta;
|
|
25
|
+
/**
|
|
26
|
+
* Parses the given text into an ESTree AST
|
|
27
|
+
*/
|
|
28
|
+
parse(text: string, options?: unknown): unknown;
|
|
29
|
+
} | {
|
|
30
|
+
/**
|
|
31
|
+
* Information about the parser to uniquely identify it when serializing.
|
|
32
|
+
*/
|
|
33
|
+
meta?: ParserMeta;
|
|
34
|
+
/**
|
|
35
|
+
* Parses the given text into an AST
|
|
36
|
+
*/
|
|
37
|
+
parseForESLint(text: string, options?: unknown): {
|
|
38
|
+
[k in keyof ParseResult]: unknown;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type ParserModule = {
|
|
42
|
+
/**
|
|
43
|
+
* Information about the parser to uniquely identify it when serializing.
|
|
44
|
+
*/
|
|
45
|
+
meta?: ParserMeta;
|
|
46
|
+
/**
|
|
47
|
+
* Parses the given text into an ESTree AST
|
|
48
|
+
*/
|
|
49
|
+
parse(text: string, options?: ParserOptions): TSESTree.Program;
|
|
50
|
+
} | {
|
|
51
|
+
/**
|
|
52
|
+
* Information about the parser to uniquely identify it when serializing.
|
|
53
|
+
*/
|
|
54
|
+
meta?: ParserMeta;
|
|
55
|
+
/**
|
|
56
|
+
* Parses the given text into an AST
|
|
57
|
+
*/
|
|
58
|
+
parseForESLint(text: string, options?: ParserOptions): ParseResult;
|
|
59
|
+
};
|
|
60
|
+
interface ParseResult {
|
|
61
|
+
/**
|
|
62
|
+
* The ESTree AST
|
|
63
|
+
*/
|
|
64
|
+
ast: TSESTree.Program;
|
|
65
|
+
/**
|
|
66
|
+
* Any parser-dependent services (such as type checkers for nodes).
|
|
67
|
+
* The value of the services property is available to rules as `context.sourceCode.parserServices`.
|
|
68
|
+
* The default is an empty object.
|
|
69
|
+
*/
|
|
70
|
+
services?: ParserServices;
|
|
71
|
+
/**
|
|
72
|
+
* A `ScopeManager` object.
|
|
73
|
+
* Custom parsers can use customized scope analysis for experimental/enhancement syntaxes.
|
|
74
|
+
* The default is the `ScopeManager` object which is created by `eslint-scope`.
|
|
75
|
+
*/
|
|
76
|
+
scopeManager?: Scope.ScopeManager;
|
|
77
|
+
/**
|
|
78
|
+
* An object to customize AST traversal.
|
|
79
|
+
* The keys of the object are the type of AST nodes.
|
|
80
|
+
* Each value is an array of the property names which should be traversed.
|
|
81
|
+
* The default is `KEYS` of `eslint-visitor-keys`.
|
|
82
|
+
*/
|
|
83
|
+
visitorKeys?: VisitorKeys;
|
|
84
|
+
}
|
|
85
|
+
interface VisitorKeys {
|
|
86
|
+
[nodeType: string]: readonly string[];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=Parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Parser.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Parser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,yBAAiB,MAAM,CAAC;IACtB,UAAiB,UAAU;QACzB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QACb;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IAED;;;;OAIG;IACH,KAAY,iBAAiB,GACzB;QACE;;WAEG;QACH,IAAI,CAAC,EAAE,UAAU,CAAC;QAClB;;WAEG;QACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;KACjD,GACD;QACE;;WAEG;QACH,IAAI,CAAC,EAAE,UAAU,CAAC;QAClB;;WAEG;QACH,cAAc,CACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,OAAO,GAChB;aAEA,CAAC,IAAI,MAAM,WAAW,GAAG,OAAO;SAClC,CAAC;KACH,CAAC;IAEN,KAAY,YAAY,GACpB;QACE;;WAEG;QACH,IAAI,CAAC,EAAE,UAAU,CAAC;QAClB;;WAEG;QACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC;KAChE,GACD;QACE;;WAEG;QACH,IAAI,CAAC,EAAE,UAAU,CAAC;QAClB;;WAEG;QACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,WAAW,CAAC;KACpE,CAAC;IAEN,UAAiB,WAAW;QAC1B;;WAEG;QACH,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC;QACtB;;;;WAIG;QACH,QAAQ,CAAC,EAAE,cAAc,CAAC;QAC1B;;;;WAIG;QACH,YAAY,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;QAClC;;;;;WAKG;QACH,WAAW,CAAC,EAAE,WAAW,CAAC;KAC3B;IAGD,UAAiB,WAAW;QAC1B,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;KACvC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Parser.js","sourceRoot":"","sources":["../../src/ts-eslint/Parser.ts"],"names":[],"mappings":";AAAA,oDAAoD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Linter } from './Linter';
|
|
2
|
+
export declare namespace Processor {
|
|
3
|
+
interface ProcessorMeta {
|
|
4
|
+
/**
|
|
5
|
+
* The unique name of the processor.
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* The a string identifying the version of the processor.
|
|
10
|
+
*/
|
|
11
|
+
version?: string;
|
|
12
|
+
}
|
|
13
|
+
type PreProcess = (text: string, filename: string) => (string | {
|
|
14
|
+
text: string;
|
|
15
|
+
filename: string;
|
|
16
|
+
})[];
|
|
17
|
+
type PostProcess = (messagesList: Linter.LintMessage[][], filename: string) => Linter.LintMessage[];
|
|
18
|
+
interface ProcessorModule {
|
|
19
|
+
/**
|
|
20
|
+
* Information about the processor to uniquely identify it when serializing.
|
|
21
|
+
*/
|
|
22
|
+
meta?: ProcessorMeta;
|
|
23
|
+
/**
|
|
24
|
+
* The function to extract code blocks.
|
|
25
|
+
*/
|
|
26
|
+
preprocess?: PreProcess;
|
|
27
|
+
/**
|
|
28
|
+
* The function to merge messages.
|
|
29
|
+
*/
|
|
30
|
+
postprocess?: PostProcess;
|
|
31
|
+
/**
|
|
32
|
+
* If `true` then it means the processor supports autofix.
|
|
33
|
+
*/
|
|
34
|
+
supportsAutofix?: boolean;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=Processor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Processor.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Processor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,yBAAiB,SAAS,CAAC;IACzB,UAAiB,aAAa;QAC5B;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QACb;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IAED,KAAY,UAAU,GAAG,CACvB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb,CAAC,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAErD,KAAY,WAAW,GAAG,CACxB,YAAY,EAAE,MAAM,CAAC,WAAW,EAAE,EAAE,EACpC,QAAQ,EAAE,MAAM,KACb,MAAM,CAAC,WAAW,EAAE,CAAC;IAE1B,UAAiB,eAAe;QAC9B;;WAEG;QACH,IAAI,CAAC,EAAE,aAAa,CAAC;QAErB;;WAEG;QACH,UAAU,CAAC,EAAE,UAAU,CAAC;QAExB;;WAEG;QACH,WAAW,CAAC,EAAE,WAAW,CAAC;QAE1B;;WAEG;QACH,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Processor.js","sourceRoot":"","sources":["../../src/ts-eslint/Processor.ts"],"names":[],"mappings":";AAAA,oDAAoD"}
|