@typescript-eslint/utils 6.10.1-alpha.8 → 6.11.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.
Files changed (46) hide show
  1. package/dist/ast-utils/helpers.d.ts +12 -12
  2. package/dist/eslint-utils/applyDefault.js.map +1 -1
  3. package/dist/eslint-utils/context.d.ts +10 -0
  4. package/dist/eslint-utils/context.d.ts.map +1 -0
  5. package/dist/eslint-utils/context.js +32 -0
  6. package/dist/eslint-utils/context.js.map +1 -0
  7. package/dist/eslint-utils/deepMerge.js.map +1 -1
  8. package/dist/eslint-utils/getParserServices.d.ts.map +1 -1
  9. package/dist/eslint-utils/getParserServices.js +8 -2
  10. package/dist/eslint-utils/getParserServices.js.map +1 -1
  11. package/dist/eslint-utils/index.d.ts +1 -0
  12. package/dist/eslint-utils/index.d.ts.map +1 -1
  13. package/dist/eslint-utils/index.js +1 -0
  14. package/dist/eslint-utils/index.js.map +1 -1
  15. package/dist/eslint-utils/nullThrows.js.map +1 -1
  16. package/dist/ts-eslint/Config.d.ts +222 -0
  17. package/dist/ts-eslint/Config.d.ts.map +1 -0
  18. package/dist/ts-eslint/Config.js +4 -0
  19. package/dist/ts-eslint/Config.js.map +1 -0
  20. package/dist/ts-eslint/ESLint.d.ts +4 -3
  21. package/dist/ts-eslint/ESLint.d.ts.map +1 -1
  22. package/dist/ts-eslint/ESLint.js.map +1 -1
  23. package/dist/ts-eslint/Linter.d.ts +42 -125
  24. package/dist/ts-eslint/Linter.d.ts.map +1 -1
  25. package/dist/ts-eslint/Linter.js.map +1 -1
  26. package/dist/ts-eslint/Parser.d.ts +63 -0
  27. package/dist/ts-eslint/Parser.d.ts.map +1 -0
  28. package/dist/ts-eslint/Parser.js +4 -0
  29. package/dist/ts-eslint/Parser.js.map +1 -0
  30. package/dist/ts-eslint/Processor.d.ts +37 -0
  31. package/dist/ts-eslint/Processor.d.ts.map +1 -0
  32. package/dist/ts-eslint/Processor.js +4 -0
  33. package/dist/ts-eslint/Processor.js.map +1 -0
  34. package/dist/ts-eslint/Rule.d.ts +92 -1
  35. package/dist/ts-eslint/Rule.d.ts.map +1 -1
  36. package/dist/ts-eslint/RuleTester.d.ts +4 -3
  37. package/dist/ts-eslint/RuleTester.d.ts.map +1 -1
  38. package/dist/ts-eslint/RuleTester.js.map +1 -1
  39. package/dist/ts-eslint/SourceCode.d.ts +27 -1
  40. package/dist/ts-eslint/SourceCode.d.ts.map +1 -1
  41. package/dist/ts-eslint/SourceCode.js.map +1 -1
  42. package/dist/ts-eslint/index.d.ts +3 -0
  43. package/dist/ts-eslint/index.d.ts.map +1 -1
  44. package/dist/ts-eslint/index.js +3 -0
  45. package/dist/ts-eslint/index.js.map +1 -1
  46. package/package.json +6 -6
@@ -1,7 +1,7 @@
1
- import type { ParserServices, TSESTree } from '../ts-estree';
2
- import type { ParserOptions as TSParserOptions } from './ParserOptions';
3
- import type { RuleCreateFunction, RuleFix, RuleModule, SharedConfigurationSettings } from './Rule';
4
- import type { Scope } from './Scope';
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 { 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: Linter.ParserModule): void;
18
+ defineParser(parserId: string, parserModule: Parser.ParserModule): 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.Config, filenameOrOptions?: Linter.VerifyOptions | string): Linter.LintMessage[];
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.Config, options: Linter.FixOptions): Linter.FixReport;
57
+ verifyAndFix(code: string, config: Linter.ConfigType, options: Linter.FixOptions): Linter.FixReport;
58
58
  /**
59
59
  * The version from package.json.
60
60
  */
@@ -65,89 +65,29 @@ declare class LinterBase {
65
65
  static readonly version: string;
66
66
  }
67
67
  declare namespace Linter {
68
- export interface LinterOptions {
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
- export type Severity = 0 | 1 | 2;
75
- export type SeverityString = 'error' | 'off' | 'warn';
76
- export type RuleLevel = Severity | SeverityString;
77
- export type RuleLevelAndOptions = [RuleLevel, ...unknown[]];
78
- export type RuleEntry = RuleLevel | RuleLevelAndOptions;
79
- export type RulesRecord = Partial<Record<string, RuleEntry>>;
80
- export type GlobalVariableOptionBase = 'off' | 'readonly' | 'writable';
81
- export type GlobalVariableOption = GlobalVariableOptionBase | boolean;
82
- export type GlobalsConfig = Record<string, GlobalVariableOption>;
83
- export type EnvironmentConfig = Record<string, boolean>;
84
- interface BaseConfig {
85
- $schema?: string;
86
- /**
87
- * The environment settings.
88
- */
89
- env?: EnvironmentConfig;
90
- /**
91
- * The path to other config files or the package name of shareable configs.
92
- */
93
- extends?: string[] | string;
94
- /**
95
- * The global variable settings.
96
- */
97
- globals?: GlobalsConfig;
98
- /**
99
- * The flag that disables directive comments.
100
- */
101
- noInlineConfig?: boolean;
102
- /**
103
- * The override settings per kind of files.
104
- */
105
- overrides?: ConfigOverride[];
106
- /**
107
- * The path to a parser or the package name of a parser.
108
- */
109
- parser?: string;
110
- /**
111
- * The parser options.
112
- */
113
- parserOptions?: ParserOptions;
114
- /**
115
- * The plugin specifiers.
116
- */
117
- plugins?: string[];
118
- /**
119
- * The processor specifier.
120
- */
121
- processor?: string;
122
- /**
123
- * The flag to report unused `eslint-disable` comments.
124
- */
125
- reportUnusedDisableDirectives?: boolean;
126
- /**
127
- * The rule settings.
128
- */
129
- rules?: RulesRecord;
130
- /**
131
- * The shared settings.
132
- */
133
- settings?: SharedConfigurationSettings;
134
- }
135
- export interface ConfigOverride extends BaseConfig {
136
- excludedFiles?: string[] | string;
137
- files: string[] | string;
138
- }
139
- export interface Config extends BaseConfig {
140
- /**
141
- * The glob patterns that ignore to lint.
142
- */
143
- ignorePatterns?: string[] | string;
144
- /**
145
- * The root flag.
146
- */
147
- root?: boolean;
148
- }
149
- export type ParserOptions = TSParserOptions;
150
- 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 RuleEntry = SharedConfig.RuleEntry;
80
+ type RuleLevel = SharedConfig.RuleLevel;
81
+ type RuleLevelAndOptions = SharedConfig.RuleLevelAndOptions;
82
+ type RulesRecord = SharedConfig.RulesRecord;
83
+ type Severity = SharedConfig.Severity;
84
+ type SeverityString = SharedConfig.SeverityString;
85
+ /** @deprecated use ClassicConfig.ConfigType instead */
86
+ type Config = ClassicConfig.Config;
87
+ type ConfigType = ClassicConfig.Config | FlatConfig.ConfigArray;
88
+ /** @deprecated use ClassicConfig.ConfigOverride instead */
89
+ type ConfigOverride = ClassicConfig.ConfigOverride;
90
+ interface VerifyOptions {
151
91
  /**
152
92
  * Allow/disallow inline comments' ability to change config once it is set. Defaults to true if not supplied.
153
93
  * Useful if you want to validate JS without comments overriding rules.
@@ -172,29 +112,29 @@ declare namespace Linter {
172
112
  * the messages as appropriate, and return a one-dimensional array of
173
113
  * messages.
174
114
  */
175
- postprocess?: Processor['postprocess'];
115
+ postprocess?: ProcessorType.PostProcess;
176
116
  /**
177
117
  * preprocessor for source text.
178
118
  * If provided, this should accept a string of source text, and return an array of code blocks to lint.
179
119
  */
180
- preprocess?: Processor['preprocess'];
120
+ preprocess?: ProcessorType.PreProcess;
181
121
  /**
182
122
  * Adds reported errors for unused `eslint-disable` directives.
183
123
  */
184
124
  reportUnusedDisableDirectives?: SeverityString | boolean;
185
125
  }
186
- export interface FixOptions extends VerifyOptions {
126
+ interface FixOptions extends VerifyOptions {
187
127
  /**
188
128
  * Determines whether fixes should be applied.
189
129
  */
190
130
  fix?: boolean;
191
131
  }
192
- export interface LintSuggestion {
132
+ interface LintSuggestion {
193
133
  desc: string;
194
134
  fix: RuleFix;
195
135
  messageId?: string;
196
136
  }
197
- export interface LintMessage {
137
+ interface LintMessage {
198
138
  /**
199
139
  * The 1-based column number.
200
140
  */
@@ -239,7 +179,7 @@ declare namespace Linter {
239
179
  */
240
180
  suggestions?: LintSuggestion[];
241
181
  }
242
- export interface FixReport {
182
+ interface FixReport {
243
183
  /**
244
184
  * True, if the code was fixed
245
185
  */
@@ -253,49 +193,27 @@ declare namespace Linter {
253
193
  */
254
194
  messages: LintMessage[];
255
195
  }
256
- export type ParserModule = {
257
- parse(text: string, options?: ParserOptions): TSESTree.Program;
258
- } | {
259
- parseForESLint(text: string, options?: ParserOptions): ESLintParseResult;
260
- };
261
- export interface ESLintParseResult {
262
- ast: TSESTree.Program;
263
- services?: ParserServices;
264
- scopeManager?: Scope.ScopeManager;
265
- visitorKeys?: SourceCode.VisitorKeys;
266
- }
267
- export interface Processor {
268
- /**
269
- * The function to extract code blocks.
270
- */
271
- preprocess?: (text: string, filename: string) => (string | {
272
- text: string;
273
- filename: string;
274
- })[];
275
- /**
276
- * The function to merge messages.
277
- */
278
- postprocess?: (messagesList: Linter.LintMessage[][], filename: string) => Linter.LintMessage[];
279
- /**
280
- * If `true` then it means the processor supports autofix.
281
- */
282
- supportsAutofix?: boolean;
283
- }
284
- export interface Environment {
196
+ /** @deprecated use Parser.ParserModule */
197
+ type ParserModule = Parser.ParserModule;
198
+ /** @deprecated use Parser.ParseResult */
199
+ type ESLintParseResult = Parser.ParseResult;
200
+ /** @deprecated use Processor.ProcessorModule */
201
+ type Processor = ProcessorType.ProcessorModule;
202
+ interface Environment {
285
203
  /**
286
204
  * The definition of global variables.
287
205
  */
288
- globals?: Record<string, Linter.Config>;
206
+ globals?: GlobalsConfig;
289
207
  /**
290
208
  * The parser options that will be enabled under this environment.
291
209
  */
292
210
  parserOptions?: ParserOptions;
293
211
  }
294
- export interface Plugin {
212
+ interface Plugin {
295
213
  /**
296
214
  * The definition of plugin configs.
297
215
  */
298
- configs?: Record<string, Linter.Config>;
216
+ configs?: Record<string, ClassicConfig.Config>;
299
217
  /**
300
218
  * The definition of plugin environments.
301
219
  */
@@ -303,13 +221,12 @@ declare namespace Linter {
303
221
  /**
304
222
  * The definition of plugin processors.
305
223
  */
306
- processors?: Record<string, Processor>;
224
+ processors?: Record<string, ProcessorType.ProcessorModule>;
307
225
  /**
308
226
  * The definition of plugin rules.
309
227
  */
310
228
  rules?: Record<string, RuleCreateFunction | RuleModule<string, unknown[]>>;
311
229
  }
312
- export {};
313
230
  }
314
231
  declare const Linter_base: typeof LinterBase;
315
232
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Linter.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/Linter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,cAAc,CA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AAE,aAAa,CAAC;QACxB;;WAEG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;KAC/B;IAED,UAAiB,MAAM;QACrB;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;QAC/C;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAC3C;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;QAC3D;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;KAC5E;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;AAiYhD;;;;GAIG;AACH,MAAM,MAAO,SAAS,eAAkC;CAAG;AAElD,wBAAM"}
1
+ {"version":3,"file":"Linter.js","sourceRoot":"","sources":["../../src/ts-eslint/Linter.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,mCAAgD;AA0RhD;;;;GAIG;AACH,MAAM,MAAO,SAAS,eAAkC;CAAG;AAElD,wBAAM"}
@@ -0,0 +1,63 @@
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
+ type ParserModule = {
16
+ /**
17
+ * Information about the parser to uniquely identify it when serializing.
18
+ */
19
+ meta?: ParserMeta;
20
+ /**
21
+ * Parses the given text into an ESTree AST
22
+ */
23
+ parse(text: string, options?: ParserOptions): TSESTree.Program;
24
+ } | {
25
+ /**
26
+ * Information about the parser to uniquely identify it when serializing.
27
+ */
28
+ meta?: ParserMeta;
29
+ /**
30
+ * Parses the given text into an AST
31
+ */
32
+ parseForESLint(text: string, options?: ParserOptions): ParseResult;
33
+ };
34
+ interface ParseResult {
35
+ /**
36
+ * The ESTree AST
37
+ */
38
+ ast: TSESTree.Program;
39
+ /**
40
+ * Any parser-dependent services (such as type checkers for nodes).
41
+ * The value of the services property is available to rules as `context.sourceCode.parserServices`.
42
+ * The default is an empty object.
43
+ */
44
+ services?: ParserServices;
45
+ /**
46
+ * A `ScopeManager` object.
47
+ * Custom parsers can use customized scope analysis for experimental/enhancement syntaxes.
48
+ * The default is the `ScopeManager` object which is created by `eslint-scope`.
49
+ */
50
+ scopeManager?: Scope.ScopeManager;
51
+ /**
52
+ * An object to customize AST traversal.
53
+ * The keys of the object are the type of AST nodes.
54
+ * Each value is an array of the property names which should be traversed.
55
+ * The default is `KEYS` of `eslint-visitor-keys`.
56
+ */
57
+ visitorKeys?: VisitorKeys;
58
+ }
59
+ interface VisitorKeys {
60
+ [nodeType: string]: string[];
61
+ }
62
+ }
63
+ //# 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,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,MAAM,EAAE,CAAC;KAC9B;CACF"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-namespace */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=Parser.js.map
@@ -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,4 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-namespace */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=Processor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Processor.js","sourceRoot":"","sources":["../../src/ts-eslint/Processor.ts"],"names":[],"mappings":";AAAA,oDAAoD"}
@@ -153,6 +153,8 @@ interface RuleContext<TMessageIds extends string, TOptions extends readonly unkn
153
153
  parserOptions: Linter.ParserOptions;
154
154
  /**
155
155
  * An object containing parser-provided services for rules
156
+ *
157
+ * @deprecated in favor of `SourceCode#parserServices`
156
158
  */
157
159
  parserServices?: ParserServices;
158
160
  /**
@@ -164,17 +166,22 @@ interface RuleContext<TMessageIds extends string, TOptions extends readonly unkn
164
166
  * Returns an array of the ancestors of the currently-traversed node, starting at
165
167
  * the root of the AST and continuing through the direct parent of the current node.
166
168
  * This array does not include the currently-traversed node itself.
169
+ *
170
+ * @deprecated in favor of `SourceCode#getAncestors`
167
171
  */
168
172
  getAncestors(): TSESTree.Node[];
169
173
  /**
170
174
  * Returns a list of variables declared by the given node.
171
175
  * This information can be used to track references to variables.
176
+ *
177
+ * @deprecated in favor of `SourceCode#getDeclaredVariables`
172
178
  */
173
179
  getDeclaredVariables(node: TSESTree.Node): readonly Scope.Variable[];
174
180
  /**
175
181
  * Returns the current working directory passed to Linter.
176
182
  * It is a path to a directory that should be considered as the current working directory.
177
183
  * @since 6.6.0
184
+ * @deprecated in favor of `RuleContext#cwd`
178
185
  */
179
186
  getCwd(): string;
180
187
  /**
@@ -185,6 +192,8 @@ interface RuleContext<TMessageIds extends string, TOptions extends readonly unkn
185
192
  cwd: string;
186
193
  /**
187
194
  * Returns the filename associated with the source.
195
+ *
196
+ * @deprecated in favor of `RuleContext#filename`
188
197
  */
189
198
  getFilename(): string;
190
199
  /**
@@ -195,6 +204,7 @@ interface RuleContext<TMessageIds extends string, TOptions extends readonly unkn
195
204
  /**
196
205
  * Returns the full path of the file on disk without any code block information (unlike `getFilename()`).
197
206
  * @since 7.28.0
207
+ * @deprecated in favor of `RuleContext#physicalFilename`
198
208
  */
199
209
  getPhysicalFilename?(): string;
200
210
  /**
@@ -205,11 +215,15 @@ interface RuleContext<TMessageIds extends string, TOptions extends readonly unkn
205
215
  /**
206
216
  * Returns the scope of the currently-traversed node.
207
217
  * This information can be used track references to variables.
218
+ *
219
+ * @deprecated in favor of `SourceCode#getScope`
208
220
  */
209
221
  getScope(): Scope.Scope;
210
222
  /**
211
223
  * Returns a SourceCode object that you can use to work with the source that
212
224
  * was passed to ESLint.
225
+ *
226
+ * @deprecated in favor of `RuleContext#sourceCode`
213
227
  */
214
228
  getSourceCode(): Readonly<SourceCode>;
215
229
  /**
@@ -221,6 +235,8 @@ interface RuleContext<TMessageIds extends string, TOptions extends readonly unkn
221
235
  /**
222
236
  * Marks a variable with the given name in the current scope as used.
223
237
  * This affects the no-unused-vars rule.
238
+ *
239
+ * @deprecated in favor of `SourceCode#markVariableAsUsed`
224
240
  */
225
241
  markVariableAsUsed(name: string): boolean;
226
242
  /**
@@ -228,6 +244,81 @@ interface RuleContext<TMessageIds extends string, TOptions extends readonly unkn
228
244
  */
229
245
  report(descriptor: ReportDescriptor<TMessageIds>): void;
230
246
  }
247
+ /**
248
+ * Part of the code path analysis feature of ESLint:
249
+ * https://eslint.org/docs/latest/extend/code-path-analysis
250
+ *
251
+ * These are used in the `onCodePath*` methods. (Note that the `node` parameter
252
+ * of these methods is intentionally omitted.)
253
+ *
254
+ * @see https://github.com/typescript-eslint/typescript-eslint/issues/6993
255
+ */
256
+ interface CodePath {
257
+ /**
258
+ * A unique string. Respective rules can use `id` to save additional
259
+ * information for each code path.
260
+ */
261
+ id: string;
262
+ initialSegment: CodePathSegment;
263
+ /** The final segments which includes both returned and thrown. */
264
+ finalSegments: CodePathSegment[];
265
+ /** The final segments which includes only returned. */
266
+ returnedSegments: CodePathSegment[];
267
+ /** The final segments which includes only thrown. */
268
+ thrownSegments: CodePathSegment[];
269
+ /**
270
+ * Segments of the current traversal position.
271
+ *
272
+ * @deprecated
273
+ */
274
+ currentSegments: CodePathSegment[];
275
+ /** The code path of the upper function/global scope. */
276
+ upper: CodePath | null;
277
+ /** Code paths of functions this code path contains. */
278
+ childCodePaths: CodePath[];
279
+ }
280
+ /**
281
+ * Part of the code path analysis feature of ESLint:
282
+ * https://eslint.org/docs/latest/extend/code-path-analysis
283
+ *
284
+ * These are used in the `onCodePath*` methods. (Note that the `node` parameter
285
+ * of these methods is intentionally omitted.)
286
+ *
287
+ * @see https://github.com/typescript-eslint/typescript-eslint/issues/6993
288
+ */
289
+ interface CodePathSegment {
290
+ /**
291
+ * A unique string. Respective rules can use `id` to save additional
292
+ * information for each segment.
293
+ */
294
+ id: string;
295
+ /**
296
+ * The next segments. If forking, there are two or more. If final, there is
297
+ * nothing.
298
+ */
299
+ nextSegments: CodePathSegment[];
300
+ /**
301
+ * The previous segments. If merging, there are two or more. If initial, there
302
+ * is nothing.
303
+ */
304
+ prevSegments: CodePathSegment[];
305
+ /**
306
+ * A flag which shows whether it is reachable. This becomes `false` when
307
+ * preceded by `return`, `throw`, `break`, or `continue`.
308
+ */
309
+ reachable: boolean;
310
+ }
311
+ /**
312
+ * Part of the code path analysis feature of ESLint:
313
+ * https://eslint.org/docs/latest/extend/code-path-analysis
314
+ *
315
+ * This type is unused in the `typescript-eslint` codebase since putting it on
316
+ * the `nodeSelector` for `RuleListener` would break the existing definition.
317
+ * However, it is exported here for the purposes of manual type-assertion.
318
+ *
319
+ * @see https://github.com/typescript-eslint/typescript-eslint/issues/6993
320
+ */
321
+ type CodePathFunction = ((fromSegment: CodePathSegment, toSegment: CodePathSegment, node: TSESTree.Node) => void) | ((codePath: CodePath, node: TSESTree.Node) => void) | ((segment: CodePathSegment, node: TSESTree.Node) => void);
231
322
  type RuleFunction<T extends TSESTree.NodeOrTokenData = never> = (node: T) => void;
232
323
  interface RuleListenerBaseSelectors {
233
324
  ArrayExpression?: RuleFunction<TSESTree.ArrayExpression>;
@@ -413,5 +504,5 @@ interface RuleModule<TMessageIds extends string, TOptions extends readonly unkno
413
504
  type AnyRuleModule = RuleModule<string, readonly unknown[]>;
414
505
  type RuleCreateFunction<TMessageIds extends string = never, TOptions extends readonly unknown[] = unknown[]> = (context: Readonly<RuleContext<TMessageIds, TOptions>>) => RuleListener;
415
506
  type AnyRuleCreateFunction = RuleCreateFunction<string, readonly unknown[]>;
416
- export { AnyRuleCreateFunction, AnyRuleModule, ReportDescriptor, ReportDescriptorMessageData, ReportFixFunction, ReportSuggestionArray, RuleContext, RuleCreateFunction, RuleFix, RuleFixer, RuleFunction, RuleListener, RuleListenerExtension, RuleMetaData, RuleMetaDataDocs, RuleModule, SharedConfigurationSettings, };
507
+ export { AnyRuleCreateFunction, AnyRuleModule, CodePath, CodePathFunction, CodePathSegment, ReportDescriptor, ReportDescriptorMessageData, ReportFixFunction, ReportSuggestionArray, RuleContext, RuleCreateFunction, RuleFix, RuleFixer, RuleFunction, RuleListener, RuleListenerExtension, RuleMetaData, RuleMetaDataDocs, RuleModule, SharedConfigurationSettings, };
417
508
  //# sourceMappingURL=Rule.d.ts.map