@typescript-eslint/utils 6.0.0-alpha.99 → 6.0.1-alpha.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 (96) hide show
  1. package/README.md +3 -1
  2. package/{_ts4.2 → _ts4.3}/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts +2 -2
  3. package/{_ts4.2 → _ts4.3}/dist/ast-utils/eslint-utils/astUtilities.d.ts +3 -3
  4. package/{_ts4.2 → _ts4.3}/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts +1 -1
  5. package/{_ts4.2 → _ts4.3}/dist/ast-utils/helpers.d.ts +3 -3
  6. package/{_ts4.2 → _ts4.3}/dist/ast-utils/predicates.d.ts +16 -16
  7. package/{_ts4.2 → _ts4.3}/dist/eslint-utils/RuleCreator.d.ts +2 -2
  8. package/{_ts4.2 → _ts4.3}/dist/eslint-utils/deepMerge.d.ts +1 -1
  9. package/_ts4.3/dist/eslint-utils/getParserServices.d.ts +24 -0
  10. package/{_ts4.2 → _ts4.3}/dist/eslint-utils/index.d.ts +0 -2
  11. package/_ts4.3/dist/json-schema.d.ts +392 -0
  12. package/{_ts4.2 → _ts4.3}/dist/ts-eslint/CLIEngine.d.ts +1 -1
  13. package/{_ts4.2 → _ts4.3}/dist/ts-eslint/ESLint.d.ts +3 -3
  14. package/{_ts4.2 → _ts4.3}/dist/ts-eslint/Linter.d.ts +22 -17
  15. package/{_ts4.2 → _ts4.3}/dist/ts-eslint/Rule.d.ts +20 -9
  16. package/{_ts4.2 → _ts4.3}/dist/ts-eslint/RuleTester.d.ts +5 -5
  17. package/{_ts4.2 → _ts4.3}/dist/ts-eslint/Scope.d.ts +1 -1
  18. package/{_ts4.2 → _ts4.3}/dist/ts-eslint/SourceCode.d.ts +3 -3
  19. package/dist/ast-utils/eslint-utils/PatternMatcher.d.ts.map +1 -1
  20. package/dist/ast-utils/eslint-utils/PatternMatcher.js.map +1 -1
  21. package/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts +2 -2
  22. package/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts.map +1 -1
  23. package/dist/ast-utils/eslint-utils/astUtilities.d.ts +3 -3
  24. package/dist/ast-utils/eslint-utils/astUtilities.d.ts.map +1 -1
  25. package/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts +1 -1
  26. package/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts.map +1 -1
  27. package/dist/ast-utils/helpers.d.ts +3 -3
  28. package/dist/ast-utils/predicates.d.ts +16 -16
  29. package/dist/ast-utils/predicates.d.ts.map +1 -1
  30. package/dist/eslint-utils/RuleCreator.d.ts +2 -2
  31. package/dist/eslint-utils/RuleCreator.d.ts.map +1 -1
  32. package/dist/eslint-utils/RuleCreator.js.map +1 -1
  33. package/dist/eslint-utils/deepMerge.d.ts +1 -1
  34. package/dist/eslint-utils/deepMerge.d.ts.map +1 -1
  35. package/dist/eslint-utils/deepMerge.js.map +1 -1
  36. package/dist/eslint-utils/getParserServices.d.ts +18 -3
  37. package/dist/eslint-utils/getParserServices.d.ts.map +1 -1
  38. package/dist/eslint-utils/getParserServices.js +1 -5
  39. package/dist/eslint-utils/getParserServices.js.map +1 -1
  40. package/dist/eslint-utils/index.d.ts +0 -2
  41. package/dist/eslint-utils/index.d.ts.map +1 -1
  42. package/dist/eslint-utils/index.js +0 -2
  43. package/dist/eslint-utils/index.js.map +1 -1
  44. package/dist/json-schema.d.ts +391 -1
  45. package/dist/json-schema.d.ts.map +1 -1
  46. package/dist/json-schema.js +6 -3
  47. package/dist/json-schema.js.map +1 -1
  48. package/dist/ts-eslint/CLIEngine.d.ts +1 -1
  49. package/dist/ts-eslint/CLIEngine.d.ts.map +1 -1
  50. package/dist/ts-eslint/ESLint.d.ts +3 -3
  51. package/dist/ts-eslint/ESLint.d.ts.map +1 -1
  52. package/dist/ts-eslint/Linter.d.ts +21 -17
  53. package/dist/ts-eslint/Linter.d.ts.map +1 -1
  54. package/dist/ts-eslint/Linter.js.map +1 -1
  55. package/dist/ts-eslint/Rule.d.ts +20 -9
  56. package/dist/ts-eslint/Rule.d.ts.map +1 -1
  57. package/dist/ts-eslint/RuleTester.d.ts +5 -5
  58. package/dist/ts-eslint/RuleTester.d.ts.map +1 -1
  59. package/dist/ts-eslint/RuleTester.js.map +1 -1
  60. package/dist/ts-eslint/Scope.d.ts +1 -1
  61. package/dist/ts-eslint/Scope.d.ts.map +1 -1
  62. package/dist/ts-eslint/Scope.js +1 -2
  63. package/dist/ts-eslint/Scope.js.map +1 -1
  64. package/dist/ts-eslint/SourceCode.d.ts +3 -3
  65. package/dist/ts-eslint/SourceCode.d.ts.map +1 -1
  66. package/package.json +14 -14
  67. package/_ts4.2/dist/eslint-utils/batchedSingleLineTests.d.ts +0 -24
  68. package/_ts4.2/dist/eslint-utils/getParserServices.d.ts +0 -9
  69. package/_ts4.2/dist/eslint-utils/rule-tester/RuleTester.d.ts +0 -49
  70. package/_ts4.2/dist/eslint-utils/rule-tester/dependencyConstraints.d.ts +0 -17
  71. package/_ts4.2/dist/json-schema.d.ts +0 -2
  72. package/dist/eslint-utils/batchedSingleLineTests.d.ts +0 -24
  73. package/dist/eslint-utils/batchedSingleLineTests.d.ts.map +0 -1
  74. package/dist/eslint-utils/batchedSingleLineTests.js +0 -36
  75. package/dist/eslint-utils/batchedSingleLineTests.js.map +0 -1
  76. package/dist/eslint-utils/rule-tester/RuleTester.d.ts +0 -49
  77. package/dist/eslint-utils/rule-tester/RuleTester.d.ts.map +0 -1
  78. package/dist/eslint-utils/rule-tester/RuleTester.js +0 -250
  79. package/dist/eslint-utils/rule-tester/RuleTester.js.map +0 -1
  80. package/dist/eslint-utils/rule-tester/dependencyConstraints.d.ts +0 -17
  81. package/dist/eslint-utils/rule-tester/dependencyConstraints.d.ts.map +0 -1
  82. package/dist/eslint-utils/rule-tester/dependencyConstraints.js +0 -53
  83. package/dist/eslint-utils/rule-tester/dependencyConstraints.js.map +0 -1
  84. /package/{_ts4.2 → _ts4.3}/dist/ast-utils/eslint-utils/PatternMatcher.d.ts +0 -0
  85. /package/{_ts4.2 → _ts4.3}/dist/ast-utils/eslint-utils/index.d.ts +0 -0
  86. /package/{_ts4.2 → _ts4.3}/dist/ast-utils/eslint-utils/predicates.d.ts +0 -0
  87. /package/{_ts4.2 → _ts4.3}/dist/ast-utils/index.d.ts +0 -0
  88. /package/{_ts4.2 → _ts4.3}/dist/ast-utils/misc.d.ts +0 -0
  89. /package/{_ts4.2 → _ts4.3}/dist/eslint-utils/InferTypesFromRule.d.ts +0 -0
  90. /package/{_ts4.2 → _ts4.3}/dist/eslint-utils/applyDefault.d.ts +0 -0
  91. /package/{_ts4.2 → _ts4.3}/dist/eslint-utils/nullThrows.d.ts +0 -0
  92. /package/{_ts4.2 → _ts4.3}/dist/index.d.ts +0 -0
  93. /package/{_ts4.2 → _ts4.3}/dist/ts-eslint/AST.d.ts +0 -0
  94. /package/{_ts4.2 → _ts4.3}/dist/ts-eslint/ParserOptions.d.ts +0 -0
  95. /package/{_ts4.2 → _ts4.3}/dist/ts-eslint/index.d.ts +0 -0
  96. /package/{_ts4.2 → _ts4.3}/dist/ts-estree.d.ts +0 -0
@@ -30,7 +30,7 @@ declare class ESLintBase {
30
30
  * @param patterns The lint target files. This can contain any of file paths, directory paths, and glob patterns.
31
31
  * @returns The promise that will be fulfilled with an array of LintResult objects.
32
32
  */
33
- lintFiles(patterns: string | string[]): Promise<ESLint.LintResult[]>;
33
+ lintFiles(patterns: string[] | string): Promise<ESLint.LintResult[]>;
34
34
  /**
35
35
  * This method lints the given source code text and then returns the results.
36
36
  *
@@ -130,7 +130,7 @@ declare namespace ESLint {
130
130
  /**
131
131
  * The types of the rules that the eslint.lintFiles() and eslint.lintText() methods use for autofix.
132
132
  */
133
- fixTypes?: ('directive' | 'problem' | 'suggestion' | 'layout')[] | null;
133
+ fixTypes?: ('directive' | 'layout' | 'problem' | 'suggestion')[] | null;
134
134
  /**
135
135
  * If false is present, the eslint.lintFiles() method doesn't interpret glob patterns.
136
136
  */
@@ -358,7 +358,7 @@ declare namespace ESLint {
358
358
  * The method to convert the LintResult objects to text.
359
359
  * Promise return supported since 8.4.0
360
360
  */
361
- format(results: LintResult[]): string | Promise<string>;
361
+ format(results: LintResult[]): Promise<string> | string;
362
362
  }
363
363
  }
364
364
  declare const _ESLint: typeof ESLintBase;
@@ -3,6 +3,8 @@ import type { ParserOptions as TSParserOptions } from './ParserOptions';
3
3
  import type { RuleCreateFunction, RuleFix, RuleModule, SharedConfigurationSettings } from './Rule';
4
4
  import type { Scope } from './Scope';
5
5
  import type { SourceCode } from './SourceCode';
6
+ export type MinimalRuleModule<TMessageIds extends string = string, TOptions extends readonly unknown[] = [
7
+ ]> = Partial<Omit<RuleModule<TMessageIds, TOptions>, 'create'>> & Pick<RuleModule<TMessageIds, TOptions>, 'create'>;
6
8
  declare class LinterBase {
7
9
  /**
8
10
  * Initialize the Linter.
@@ -20,17 +22,17 @@ declare class LinterBase {
20
22
  * @param ruleId A unique rule identifier
21
23
  * @param ruleModule Function from context to object mapping AST node types to event handlers
22
24
  */
23
- defineRule<TMessageIds extends string, TOptions extends readonly unknown[]>(ruleId: string, ruleModule: RuleModule<TMessageIds, TOptions> | RuleCreateFunction): void;
25
+ defineRule<TMessageIds extends string, TOptions extends readonly unknown[]>(ruleId: string, ruleModule: MinimalRuleModule<TMessageIds, TOptions> | RuleCreateFunction): void;
24
26
  /**
25
27
  * Defines many new linting rules.
26
28
  * @param rulesToDefine map from unique rule identifier to rule
27
29
  */
28
- defineRules<TMessageIds extends string, TOptions extends readonly unknown[]>(rulesToDefine: Record<string, RuleModule<TMessageIds, TOptions> | RuleCreateFunction>): void;
30
+ defineRules<TMessageIds extends string, TOptions extends readonly unknown[]>(rulesToDefine: Record<string, MinimalRuleModule<TMessageIds, TOptions> | RuleCreateFunction<TMessageIds, TOptions>>): void;
29
31
  /**
30
32
  * Gets an object with all loaded rules.
31
33
  * @returns All loaded rules
32
34
  */
33
- getRules(): Map<string, RuleModule<string, unknown[]>>;
35
+ getRules(): Map<string, MinimalRuleModule<string, unknown[]>>;
34
36
  /**
35
37
  * Gets the `SourceCode` object representing the parsed source.
36
38
  * @returns The `SourceCode` object.
@@ -45,7 +47,7 @@ declare class LinterBase {
45
47
  * If this is an object, then it has "filename", "allowInlineConfig", and some properties.
46
48
  * @returns The results as an array of messages or an empty array if no messages.
47
49
  */
48
- verify(textOrSourceCode: SourceCode | string, config: Linter.Config, filenameOrOptions?: string | Linter.VerifyOptions): Linter.LintMessage[];
50
+ verify(textOrSourceCode: SourceCode | string, config: Linter.Config, filenameOrOptions?: Linter.VerifyOptions | string): Linter.LintMessage[];
49
51
  /**
50
52
  * Performs multiple autofix passes over the text until as many fixes as possible have been applied.
51
53
  * @param code The source text to apply fixes to.
@@ -71,7 +73,7 @@ declare namespace Linter {
71
73
  cwd?: string;
72
74
  }
73
75
  export type Severity = 0 | 1 | 2;
74
- export type SeverityString = 'off' | 'warn' | 'error';
76
+ export type SeverityString = 'error' | 'off' | 'warn';
75
77
  export type RuleLevel = Severity | SeverityString;
76
78
  export type RuleLevelAndOptions = [
77
79
  RuleLevel,
@@ -79,25 +81,28 @@ declare namespace Linter {
79
81
  ];
80
82
  export type RuleEntry = RuleLevel | RuleLevelAndOptions;
81
83
  export type RulesRecord = Partial<Record<string, RuleEntry>>;
82
- export type GlobalVariableOption = 'readonly' | 'writable' | 'off' | boolean;
84
+ export type GlobalVariableOptionBase = 'off' | 'readonly' | 'writable';
85
+ export type GlobalVariableOption = GlobalVariableOptionBase | boolean;
86
+ export interface GlobalsConfig {
87
+ [name: string]: GlobalVariableOption;
88
+ }
89
+ export interface EnvironmentConfig {
90
+ [name: string]: boolean;
91
+ }
83
92
  interface BaseConfig {
84
93
  $schema?: string;
85
94
  /**
86
95
  * The environment settings.
87
96
  */
88
- env?: {
89
- [name: string]: boolean;
90
- };
97
+ env?: EnvironmentConfig;
91
98
  /**
92
99
  * The path to other config files or the package name of shareable configs.
93
100
  */
94
- extends?: string | string[];
101
+ extends?: string[] | string;
95
102
  /**
96
103
  * The global variable settings.
97
104
  */
98
- globals?: {
99
- [name: string]: GlobalVariableOption;
100
- };
105
+ globals?: GlobalsConfig;
101
106
  /**
102
107
  * The flag that disables directive comments.
103
108
  */
@@ -136,14 +141,14 @@ declare namespace Linter {
136
141
  settings?: SharedConfigurationSettings;
137
142
  }
138
143
  export interface ConfigOverride extends BaseConfig {
139
- excludedFiles?: string | string[];
140
- files: string | string[];
144
+ excludedFiles?: string[] | string;
145
+ files: string[] | string;
141
146
  }
142
147
  export interface Config extends BaseConfig {
143
148
  /**
144
149
  * The glob patterns that ignore to lint.
145
150
  */
146
- ignorePatterns?: string | string[];
151
+ ignorePatterns?: string[] | string;
147
152
  /**
148
153
  * The root flag.
149
154
  */
@@ -184,7 +189,7 @@ declare namespace Linter {
184
189
  /**
185
190
  * Adds reported errors for unused `eslint-disable` directives.
186
191
  */
187
- reportUnusedDisableDirectives?: boolean | SeverityString;
192
+ reportUnusedDisableDirectives?: SeverityString | boolean;
188
193
  }
189
194
  export interface FixOptions extends VerifyOptions {
190
195
  /**
@@ -61,7 +61,7 @@ interface RuleMetaData<TMessageIds extends string> {
61
61
  * - `"suggestion"` means the rule is identifying something that could be done in a better way but no errors will occur if the code isn’t changed.
62
62
  * - `"layout"` means the rule cares primarily about whitespace, semicolons, commas, and parentheses, all the parts of the program that determine how the code looks rather than how it executes. These rules work on parts of the code that aren’t specified in the AST.
63
63
  */
64
- type: 'suggestion' | 'problem' | 'layout';
64
+ type: 'layout' | 'problem' | 'suggestion';
65
65
  /**
66
66
  * The name of the rule this rule was replaced by, if it was deprecated.
67
67
  */
@@ -88,13 +88,14 @@ interface RuleFixer {
88
88
  interface SuggestionReportDescriptor<TMessageIds extends string> extends Omit<ReportDescriptorBase<TMessageIds>, 'fix'> {
89
89
  readonly fix: ReportFixFunction;
90
90
  }
91
- type ReportFixFunction = (fixer: RuleFixer) => null | RuleFix | readonly RuleFix[] | IterableIterator<RuleFix>;
91
+ type ReportFixFunction = (fixer: RuleFixer) => IterableIterator<RuleFix> | RuleFix | readonly RuleFix[] | null;
92
92
  type ReportSuggestionArray<TMessageIds extends string> = SuggestionReportDescriptor<TMessageIds>[];
93
+ type ReportDescriptorMessageData = Readonly<Record<string, unknown>>;
93
94
  interface ReportDescriptorBase<TMessageIds extends string> {
94
95
  /**
95
96
  * The parameters for the message string associated with `messageId`.
96
97
  */
97
- readonly data?: Readonly<Record<string, unknown>>;
98
+ readonly data?: ReportDescriptorMessageData;
98
99
  /**
99
100
  * The fixer function.
100
101
  */
@@ -118,15 +119,15 @@ interface ReportDescriptorNodeOptionalLoc {
118
119
  /**
119
120
  * An override of the location of the report
120
121
  */
121
- readonly loc?: Readonly<TSESTree.SourceLocation> | Readonly<TSESTree.Position>;
122
+ readonly loc?: Readonly<TSESTree.Position> | Readonly<TSESTree.SourceLocation>;
122
123
  }
123
124
  interface ReportDescriptorLocOnly {
124
125
  /**
125
126
  * An override of the location of the report
126
127
  */
127
- loc: Readonly<TSESTree.SourceLocation> | Readonly<TSESTree.Position>;
128
+ loc: Readonly<TSESTree.Position> | Readonly<TSESTree.SourceLocation>;
128
129
  }
129
- type ReportDescriptor<TMessageIds extends string> = ReportDescriptorWithSuggestion<TMessageIds> & (ReportDescriptorNodeOptionalLoc | ReportDescriptorLocOnly);
130
+ type ReportDescriptor<TMessageIds extends string> = ReportDescriptorWithSuggestion<TMessageIds> & (ReportDescriptorLocOnly | ReportDescriptorNodeOptionalLoc);
130
131
  /**
131
132
  * Plugins can add their settings using declaration
132
133
  * merging against this interface.
@@ -208,8 +209,7 @@ interface RuleContext<TMessageIds extends string, TOptions extends readonly unkn
208
209
  report(descriptor: ReportDescriptor<TMessageIds>): void;
209
210
  }
210
211
  type RuleFunction<T extends TSESTree.NodeOrTokenData = never> = (node: T) => void;
211
- interface RuleListener {
212
- [nodeSelector: string]: RuleFunction | undefined;
212
+ interface RuleListenerBaseSelectors {
213
213
  ArrayExpression?: RuleFunction<TSESTree.ArrayExpression>;
214
214
  ArrayPattern?: RuleFunction<TSESTree.ArrayPattern>;
215
215
  ArrowFunctionExpression?: RuleFunction<TSESTree.ArrowFunctionExpression>;
@@ -368,6 +368,15 @@ interface RuleListener {
368
368
  WithStatement?: RuleFunction<TSESTree.WithStatement>;
369
369
  YieldExpression?: RuleFunction<TSESTree.YieldExpression>;
370
370
  }
371
+ type RuleListenerExitSelectors = {
372
+ [K in keyof RuleListenerBaseSelectors as `${K}:exit`]: RuleListenerBaseSelectors[K];
373
+ };
374
+ interface RuleListenerCatchAllBaseCase {
375
+ [nodeSelector: string]: RuleFunction | undefined;
376
+ }
377
+ interface RuleListenerExtension {
378
+ }
379
+ type RuleListener = RuleListenerBaseSelectors & RuleListenerCatchAllBaseCase & RuleListenerExitSelectors;
371
380
  interface RuleModule<TMessageIds extends string, TOptions extends readonly unknown[] = [
372
381
  ], TRuleListener extends RuleListener = RuleListener> {
373
382
  /**
@@ -384,6 +393,8 @@ interface RuleModule<TMessageIds extends string, TOptions extends readonly unkno
384
393
  */
385
394
  create(context: Readonly<RuleContext<TMessageIds, TOptions>>): TRuleListener;
386
395
  }
396
+ type AnyRuleModule = RuleModule<string, readonly unknown[]>;
387
397
  type RuleCreateFunction<TMessageIds extends string = never, TOptions extends readonly unknown[] = unknown[]> = (context: Readonly<RuleContext<TMessageIds, TOptions>>) => RuleListener;
388
- export { ReportDescriptor, ReportFixFunction, ReportSuggestionArray, RuleContext, RuleCreateFunction, RuleFix, RuleFixer, RuleFunction, RuleListener, RuleMetaData, RuleMetaDataDocs, RuleModule, SharedConfigurationSettings, };
398
+ type AnyRuleCreateFunction = RuleCreateFunction<string, readonly unknown[]>;
399
+ export { AnyRuleCreateFunction, AnyRuleModule, ReportDescriptor, ReportDescriptorMessageData, ReportFixFunction, ReportSuggestionArray, RuleContext, RuleCreateFunction, RuleFix, RuleFixer, RuleFunction, RuleListener, RuleListenerExtension, RuleMetaData, RuleMetaDataDocs, RuleModule, SharedConfigurationSettings, };
389
400
  //# sourceMappingURL=Rule.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import type { AST_NODE_TYPES, AST_TOKEN_TYPES } from '../ts-estree';
2
2
  import type { Linter } from './Linter';
3
3
  import type { ParserOptions } from './ParserOptions';
4
- import type { RuleCreateFunction, RuleModule, SharedConfigurationSettings } from './Rule';
4
+ import type { ReportDescriptorMessageData, RuleCreateFunction, RuleModule, SharedConfigurationSettings } from './Rule';
5
5
  interface ValidTestCase<TOptions extends Readonly<unknown[]>> {
6
6
  /**
7
7
  * Name for the test case.
@@ -23,7 +23,7 @@ interface ValidTestCase<TOptions extends Readonly<unknown[]>> {
23
23
  /**
24
24
  * The additional global variables.
25
25
  */
26
- readonly globals?: Record<string, 'readonly' | 'writable' | 'off' | true>;
26
+ readonly globals?: Record<string, 'off' | 'readonly' | 'writable' | true>;
27
27
  /**
28
28
  * Options for the test case.
29
29
  */
@@ -54,7 +54,7 @@ interface SuggestionOutput<TMessageIds extends string> {
54
54
  /**
55
55
  * The data used to fill the message template.
56
56
  */
57
- readonly data?: Readonly<Record<string, unknown>>;
57
+ readonly data?: ReportDescriptorMessageData;
58
58
  /**
59
59
  * NOTE: Suggestions will be applied as a stand-alone change, without triggering multi-pass fixes.
60
60
  * Each individual error has its own suggestion, so you have to show the correct, _isolated_ output for each suggestion.
@@ -79,7 +79,7 @@ interface TestCaseError<TMessageIds extends string> {
79
79
  /**
80
80
  * The data used to fill the message template.
81
81
  */
82
- readonly data?: Readonly<Record<string, unknown>>;
82
+ readonly data?: ReportDescriptorMessageData;
83
83
  /**
84
84
  * The 1-based column number of the reported end location.
85
85
  */
@@ -152,7 +152,7 @@ declare class RuleTesterBase {
152
152
  /**
153
153
  * Define a rule for one particular run of tests.
154
154
  */
155
- defineRule<TMessageIds extends string, TOptions extends Readonly<unknown[]>>(name: string, rule: RuleModule<TMessageIds, TOptions> | RuleCreateFunction<TMessageIds, TOptions>): void;
155
+ defineRule<TMessageIds extends string, TOptions extends Readonly<unknown[]>>(name: string, rule: RuleCreateFunction<TMessageIds, TOptions> | RuleModule<TMessageIds, TOptions>): void;
156
156
  }
157
157
  declare const RuleTester_base: typeof RuleTesterBase;
158
158
  declare class RuleTester extends RuleTester_base {
@@ -2,7 +2,7 @@ import * as scopeManager from '@typescript-eslint/scope-manager';
2
2
  declare namespace Scope {
3
3
  type ScopeManager = scopeManager.ScopeManager;
4
4
  type Reference = scopeManager.Reference;
5
- type Variable = scopeManager.Variable | scopeManager.ESLintScopeVariable;
5
+ type Variable = scopeManager.ESLintScopeVariable | scopeManager.Variable;
6
6
  type Scope = scopeManager.Scope;
7
7
  const ScopeType: typeof scopeManager.ScopeType;
8
8
  type DefinitionType = scopeManager.Definition;
@@ -220,7 +220,7 @@ declare class SourceCodeBase extends TokenStore {
220
220
  * @param second The second node or token to check between.
221
221
  * @returns True if there is a whitespace character between any of the tokens found between the two given nodes or tokens.
222
222
  */
223
- isSpaceBetween?(first: TSESTree.Token | TSESTree.Node, second: TSESTree.Token | TSESTree.Node): boolean;
223
+ isSpaceBetween?(first: TSESTree.Node | TSESTree.Token, second: TSESTree.Node | TSESTree.Token): boolean;
224
224
  /**
225
225
  * Determines if two nodes or tokens have at least one whitespace character
226
226
  * between them. Order does not matter. Returns false if the given nodes or
@@ -310,7 +310,7 @@ declare namespace SourceCode {
310
310
  type ReturnTypeFromOptions<T> = T extends {
311
311
  includeComments: true;
312
312
  } ? GetFilterPredicateFromOptions<T, TSESTree.Token> : GetFilterPredicateFromOptions<T, Exclude<TSESTree.Token, TSESTree.Comment>>;
313
- type CursorWithSkipOptions = number | FilterPredicate | {
313
+ type CursorWithSkipOptions = FilterPredicate | number | {
314
314
  /**
315
315
  * The predicate function to choose tokens.
316
316
  */
@@ -324,7 +324,7 @@ declare namespace SourceCode {
324
324
  */
325
325
  skip?: number;
326
326
  };
327
- type CursorWithCountOptions = number | FilterPredicate | {
327
+ type CursorWithCountOptions = FilterPredicate | number | {
328
328
  /**
329
329
  * The predicate function to choose tokens.
330
330
  */
@@ -1 +1 @@
1
- {"version":3,"file":"PatternMatcher.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/PatternMatcher.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAExD;;;;OAIG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAE3B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC,CACd,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,GACjD,MAAM,CAAC;CACX;AAED;;;;;GAKG;AACH,QAAA,MAAM,cAAc,gBACJ,MAAM,YAAY;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,KAAG,cACzD,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"PatternMatcher.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/PatternMatcher.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAExD;;;;OAIG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAE3B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC,CACd,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,GACjD,MAAM,CAAC;CACX;AAED;;;;;GAKG;AACH,QAAA,MAAM,cAAc,gBACT,MAAM,YACL;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,KAC5B,cAAc,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PatternMatcher.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/PatternMatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4EAA8D;AA6C9D;;;;;GAKG;AACH,MAAM,cAAc,GAAG,WAAW,CAAC,cAElC,CAAC;AAEO,wCAAc"}
1
+ {"version":3,"file":"PatternMatcher.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/PatternMatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4EAA8D;AA6C9D;;;;;GAKG;AACH,MAAM,cAAc,GAAG,WAAW,CAAC,cAGhB,CAAC;AAEX,wCAAc"}
@@ -34,7 +34,7 @@ interface ReferenceTrackerStatic {
34
34
  * If this is `"strict"`, the method binds CommonJS modules to the default export. Otherwise, the method binds
35
35
  * CommonJS modules to both the default export and named exports. Optional. Default is `"strict"`.
36
36
  */
37
- mode?: 'strict' | 'legacy';
37
+ mode?: 'legacy' | 'strict';
38
38
  /**
39
39
  * The name list of Global Object. Optional. Default is `["global", "globalThis", "self", "window"]`.
40
40
  */
@@ -50,7 +50,7 @@ declare namespace ReferenceTracker {
50
50
  type CALL = ReferenceTrackerStatic['CALL'];
51
51
  type CONSTRUCT = ReferenceTrackerStatic['CONSTRUCT'];
52
52
  type ESM = ReferenceTrackerStatic['ESM'];
53
- type ReferenceType = READ | CALL | CONSTRUCT;
53
+ type ReferenceType = CALL | CONSTRUCT | READ;
54
54
  type TraceMap<T = any> = Record<string, TraceMapElement<T>>;
55
55
  interface TraceMapElement<T> {
56
56
  [ReferenceTrackerREAD]?: T;
@@ -1 +1 @@
1
- {"version":3,"file":"ReferenceTracker.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/ReferenceTracker.ts"],"names":[],"mappings":"AAGA,OAAO,KA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AAO,yBAAyB,CAAC;IACrD,QAAQ,CAAC,GAAG,EAAE,OAAO,mBAAmB,CAAC;CAC1C;AAED,kBAAU,gBAAgB,CAAC;IACzB,KAAY,IAAI,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAClD,KAAY,IAAI,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAClD,KAAY,SAAS,GAAG,sBAAsB,CAAC,WAAW,CAAC,CAAC;IAC5D,KAAY,GAAG,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAChD,KAAY,aAAa,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;IAEpD,KAAY,QAAQ,CAAC,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,UAAiB,eAAe,CAAC,CAAC;QAChC,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,CAAC;QAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;KACnC;IAED,UAAiB,cAAc,CAAC,CAAC,GAAG,GAAG;QACrC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;QACpB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;QACxB,IAAI,EAAE,aAAa,CAAC;QACpB,IAAI,EAAE,CAAC,CAAC;KACT;CACF;AAED;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,wBAAyD,CAAC;AAEhF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -5,13 +5,13 @@ import type { TSESTree } from '../../ts-estree';
5
5
  *
6
6
  * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionheadlocation}
7
7
  */
8
- declare const getFunctionHeadLocation: (node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression, sourceCode: TSESLint.SourceCode) => TSESTree.SourceLocation;
8
+ declare const getFunctionHeadLocation: (node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression, sourceCode: TSESLint.SourceCode) => TSESTree.SourceLocation;
9
9
  /**
10
10
  * Get the name and kind of a given function node.
11
11
  *
12
12
  * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionnamewithkind}
13
13
  */
14
- declare const getFunctionNameWithKind: (node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression, sourceCode?: TSESLint.SourceCode) => string;
14
+ declare const getFunctionNameWithKind: (node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression, sourceCode?: TSESLint.SourceCode) => string;
15
15
  /**
16
16
  * Get the property name of a given property node.
17
17
  * If the node is a computed property, this tries to compute the property name by the getStringIfConstant function.
@@ -19,7 +19,7 @@ declare const getFunctionNameWithKind: (node: TSESTree.FunctionDeclaration | TSE
19
19
  * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getpropertyname}
20
20
  * @returns The property name of the node. If the property name is not constant then it returns `null`.
21
21
  */
22
- declare const getPropertyName: (node: TSESTree.MemberExpression | TSESTree.Property | TSESTree.MethodDefinition | TSESTree.PropertyDefinition, initialScope?: TSESLint.Scope.Scope) => string | null;
22
+ declare const getPropertyName: (node: TSESTree.MemberExpression | TSESTree.MethodDefinition | TSESTree.Property | TSESTree.PropertyDefinition, initialScope?: TSESLint.Scope.Scope) => string | null;
23
23
  /**
24
24
  * Get the value of a given node if it can decide the value statically.
25
25
  * If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the
@@ -1 +1 @@
1
- {"version":3,"file":"astUtilities.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/astUtilities.ts"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AAO,CAAC;CAC1C,KACE,OAAO,CAAC;AAEb,QAAA,MAAM,eAAe;WAUZ,SAAS,IAAI,cAAc,SAAS,UAAU,GAAG,OAAO;YAEtD,MAAM,QACP,SAAS,IAAI,cACP,SAAS,UAAU,GAC9B,OAAO;CACX,CAAC;AAEF,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,eAAe,GAChB,CAAC"}
@@ -5,7 +5,7 @@ import type { TSESTree } from '../../ts-estree';
5
5
  *
6
6
  * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#findvariable}
7
7
  */
8
- declare const findVariable: (initialScope: TSESLint.Scope.Scope, nameOrNode: string | TSESTree.Identifier) => TSESLint.Scope.Variable | null;
8
+ declare const findVariable: (initialScope: TSESLint.Scope.Scope, nameOrNode: TSESTree.Identifier | string) => TSESLint.Scope.Variable | null;
9
9
  /**
10
10
  * Get the innermost scope which contains a given node.
11
11
  *
@@ -1 +1 @@
1
- {"version":3,"file":"scopeAnalysis.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/scopeAnalysis.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;GAIG;AACH,QAAA,MAAM,YAAY,iBACF,SAAS,KAAK,CAAC,KAAK,cACtB,MAAM,GAAG,SAAS,UAAU,KACrC,SAAS,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;AAEpC;;;;;;GAMG;AACH,QAAA,MAAM,iBAAiB,iBACP,SAAS,KAAK,CAAC,KAAK,QAC5B,SAAS,IAAI,KAChB,SAAS,KAAK,CAAC,KAAK,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"scopeAnalysis.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/scopeAnalysis.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;GAIG;AACH,QAAA,MAAM,YAAY,iBACF,SAAS,KAAK,CAAC,KAAK,cACtB,SAAS,UAAU,GAAG,MAAM,KACrC,SAAS,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;AAEpC;;;;;;GAMG;AACH,QAAA,MAAM,iBAAiB,iBACP,SAAS,KAAK,CAAC,KAAK,QAC5B,SAAS,IAAI,KAChB,SAAS,KAAK,CAAC,KAAK,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1147,7 +1147,7 @@ export declare const isNodeOfTypeWithConditions: <NodeType extends AST_NODE_TYPE
1147
1147
  type: NodeType;
1148
1148
  }> | Extract<TSESTree.YieldExpression, {
1149
1149
  type: NodeType;
1150
- }>, Conditions extends Partial<ExtractedNode>>(nodeType: NodeType, conditions: Conditions) => (node: TSESTree.Node | null | undefined) => node is ExtractedNode & Conditions;
1150
+ }>, Conditions extends Partial<ExtractedNode>>(nodeType: NodeType, conditions: Conditions) => (node: TSESTree.Node | null | undefined) => node is Conditions & ExtractedNode;
1151
1151
  export declare const isTokenOfTypeWithConditions: <TokenType extends AST_TOKEN_TYPES, ExtractedToken extends Extract<TSESTree.BooleanToken, {
1152
1152
  type: TokenType;
1153
1153
  }> | Extract<TSESTree.BlockComment, {
@@ -1176,7 +1176,7 @@ export declare const isTokenOfTypeWithConditions: <TokenType extends AST_TOKEN_T
1176
1176
  type: TokenType;
1177
1177
  }>, Conditions extends Partial<TSESTree.Token & {
1178
1178
  type: TokenType;
1179
- }>>(tokenType: TokenType, conditions: Conditions) => (token: TSESTree.Token | null | undefined) => token is ExtractedToken & Conditions;
1179
+ }>>(tokenType: TokenType, conditions: Conditions) => (token: TSESTree.Token | null | undefined) => token is Conditions & ExtractedToken;
1180
1180
  export declare const isNotTokenOfTypeWithConditions: <TokenType extends AST_TOKEN_TYPES, ExtractedToken extends Extract<TSESTree.BooleanToken, {
1181
1181
  type: TokenType;
1182
1182
  }> | Extract<TSESTree.BlockComment, {
@@ -1203,5 +1203,5 @@ export declare const isNotTokenOfTypeWithConditions: <TokenType extends AST_TOKE
1203
1203
  type: TokenType;
1204
1204
  }> | Extract<TSESTree.TemplateToken, {
1205
1205
  type: TokenType;
1206
- }>, Conditions extends Partial<ExtractedToken>>(tokenType: TokenType, conditions: Conditions) => (token: TSESTree.Token | null | undefined) => token is Exclude<TSESTree.BooleanToken, ExtractedToken & Conditions> | Exclude<TSESTree.BlockComment, ExtractedToken & Conditions> | Exclude<TSESTree.LineComment, ExtractedToken & Conditions> | Exclude<TSESTree.IdentifierToken, ExtractedToken & Conditions> | Exclude<TSESTree.JSXIdentifierToken, ExtractedToken & Conditions> | Exclude<TSESTree.JSXTextToken, ExtractedToken & Conditions> | Exclude<TSESTree.KeywordToken, ExtractedToken & Conditions> | Exclude<TSESTree.NullToken, ExtractedToken & Conditions> | Exclude<TSESTree.NumericToken, ExtractedToken & Conditions> | Exclude<TSESTree.PunctuatorToken, ExtractedToken & Conditions> | Exclude<TSESTree.RegularExpressionToken, ExtractedToken & Conditions> | Exclude<TSESTree.StringToken, ExtractedToken & Conditions> | Exclude<TSESTree.TemplateToken, ExtractedToken & Conditions>;
1206
+ }>, Conditions extends Partial<ExtractedToken>>(tokenType: TokenType, conditions: Conditions) => (token: TSESTree.Token | null | undefined) => token is Exclude<TSESTree.BooleanToken, Conditions & ExtractedToken> | Exclude<TSESTree.BlockComment, Conditions & ExtractedToken> | Exclude<TSESTree.LineComment, Conditions & ExtractedToken> | Exclude<TSESTree.IdentifierToken, Conditions & ExtractedToken> | Exclude<TSESTree.JSXIdentifierToken, Conditions & ExtractedToken> | Exclude<TSESTree.JSXTextToken, Conditions & ExtractedToken> | Exclude<TSESTree.KeywordToken, Conditions & ExtractedToken> | Exclude<TSESTree.NullToken, Conditions & ExtractedToken> | Exclude<TSESTree.NumericToken, Conditions & ExtractedToken> | Exclude<TSESTree.PunctuatorToken, Conditions & ExtractedToken> | Exclude<TSESTree.RegularExpressionToken, Conditions & ExtractedToken> | Exclude<TSESTree.StringToken, Conditions & ExtractedToken> | Exclude<TSESTree.TemplateToken, Conditions & ExtractedToken>;
1207
1207
  //# sourceMappingURL=helpers.d.ts.map
@@ -1,22 +1,22 @@
1
1
  import type { TSESTree } from '../ts-estree';
2
- declare const isOptionalChainPunctuator: (token: TSESTree.Token | null | undefined) => token is TSESTree.PunctuatorToken & {
2
+ declare const isOptionalChainPunctuator: (token: TSESTree.Token | null | undefined) => token is {
3
3
  value: "?.";
4
- };
4
+ } & TSESTree.PunctuatorToken;
5
5
  declare const isNotOptionalChainPunctuator: (token: TSESTree.Token | null | undefined) => token is TSESTree.BooleanToken | TSESTree.BlockComment | TSESTree.LineComment | TSESTree.IdentifierToken | TSESTree.JSXIdentifierToken | TSESTree.JSXTextToken | TSESTree.KeywordToken | TSESTree.NullToken | TSESTree.NumericToken | TSESTree.PunctuatorToken | TSESTree.RegularExpressionToken | TSESTree.StringToken | TSESTree.TemplateToken;
6
- declare const isNonNullAssertionPunctuator: (token: TSESTree.Token | null | undefined) => token is TSESTree.PunctuatorToken & {
6
+ declare const isNonNullAssertionPunctuator: (token: TSESTree.Token | null | undefined) => token is {
7
7
  value: "!";
8
- };
8
+ } & TSESTree.PunctuatorToken;
9
9
  declare const isNotNonNullAssertionPunctuator: (token: TSESTree.Token | null | undefined) => token is TSESTree.BooleanToken | TSESTree.BlockComment | TSESTree.LineComment | TSESTree.IdentifierToken | TSESTree.JSXIdentifierToken | TSESTree.JSXTextToken | TSESTree.KeywordToken | TSESTree.NullToken | TSESTree.NumericToken | TSESTree.PunctuatorToken | TSESTree.RegularExpressionToken | TSESTree.StringToken | TSESTree.TemplateToken;
10
10
  /**
11
11
  * Returns true if and only if the node represents: foo?.() or foo.bar?.()
12
12
  */
13
- declare const isOptionalCallExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.CallExpression & {
13
+ declare const isOptionalCallExpression: (node: TSESTree.Node | null | undefined) => node is {
14
14
  optional: boolean;
15
- };
15
+ } & TSESTree.CallExpression;
16
16
  /**
17
17
  * Returns true if and only if the node represents logical OR
18
18
  */
19
- declare const isLogicalOrOperator: (node: TSESTree.Node | null | undefined) => node is TSESTree.LogicalExpression & Partial<TSESTree.LogicalExpression>;
19
+ declare const isLogicalOrOperator: (node: TSESTree.Node | null | undefined) => node is Partial<TSESTree.LogicalExpression> & TSESTree.LogicalExpression;
20
20
  /**
21
21
  * Checks if a node is a type assertion:
22
22
  * ```
@@ -35,13 +35,13 @@ declare const isClassOrTypeElement: (node: TSESTree.Node | null | undefined) =>
35
35
  /**
36
36
  * Checks if a node is a constructor method.
37
37
  */
38
- declare const isConstructor: (node: TSESTree.Node | null | undefined) => node is (TSESTree.MethodDefinitionComputedName & Partial<TSESTree.MethodDefinitionComputedName>) | (TSESTree.MethodDefinitionNonComputedName & Partial<TSESTree.MethodDefinitionNonComputedName>);
38
+ declare const isConstructor: (node: TSESTree.Node | null | undefined) => node is (Partial<TSESTree.MethodDefinitionComputedName> & TSESTree.MethodDefinitionComputedName) | (Partial<TSESTree.MethodDefinitionNonComputedName> & TSESTree.MethodDefinitionNonComputedName);
39
39
  /**
40
40
  * Checks if a node is a setter method.
41
41
  */
42
- declare function isSetter(node: TSESTree.Node | undefined): node is (TSESTree.MethodDefinition | TSESTree.Property) & {
42
+ declare function isSetter(node: TSESTree.Node | undefined): node is {
43
43
  kind: 'set';
44
- };
44
+ } & (TSESTree.MethodDefinition | TSESTree.Property);
45
45
  declare const isIdentifier: (node: TSESTree.Node | null | undefined) => node is TSESTree.Identifier;
46
46
  /**
47
47
  * Checks if a node represents an `await …` expression.
@@ -50,21 +50,21 @@ declare const isAwaitExpression: (node: TSESTree.Node | null | undefined) => nod
50
50
  /**
51
51
  * Checks if a possible token is the `await` keyword.
52
52
  */
53
- declare const isAwaitKeyword: (token: TSESTree.Token | null | undefined) => token is TSESTree.IdentifierToken & {
53
+ declare const isAwaitKeyword: (token: TSESTree.Token | null | undefined) => token is {
54
54
  value: "await";
55
- };
55
+ } & TSESTree.IdentifierToken;
56
56
  /**
57
57
  * Checks if a possible token is the `type` keyword.
58
58
  */
59
- declare const isTypeKeyword: (token: TSESTree.Token | null | undefined) => token is TSESTree.IdentifierToken & {
59
+ declare const isTypeKeyword: (token: TSESTree.Token | null | undefined) => token is {
60
60
  value: "type";
61
- };
61
+ } & TSESTree.IdentifierToken;
62
62
  /**
63
63
  * Checks if a possible token is the `import` keyword.
64
64
  */
65
- declare const isImportKeyword: (token: TSESTree.Token | null | undefined) => token is TSESTree.KeywordToken & {
65
+ declare const isImportKeyword: (token: TSESTree.Token | null | undefined) => token is {
66
66
  value: "import";
67
- };
67
+ } & TSESTree.KeywordToken;
68
68
  declare const isLoop: (node: TSESTree.Node | null | undefined) => node is TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.WhileStatement;
69
69
  export { isAwaitExpression, isAwaitKeyword, isConstructor, isClassOrTypeElement, isFunction, isFunctionOrFunctionType, isFunctionType, isIdentifier, isImportKeyword, isLoop, isLogicalOrOperator, isNonNullAssertionPunctuator, isNotNonNullAssertionPunctuator, isNotOptionalChainPunctuator, isOptionalChainPunctuator, isOptionalCallExpression, isSetter, isTSConstructorType, isTSFunctionType, isTypeAssertion, isTypeKeyword, isVariableDeclarator, };
70
70
  //# sourceMappingURL=predicates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"predicates.d.ts","sourceRoot":"","sources":["../../src/ast-utils/predicates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAU7C,QAAA,MAAM,yBAAyB;;CAG9B,CAAC;AAEF,QAAA,MAAM,4BAA4B,gYAGjC,CAAC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BAAiB,8EAA+C,CAAC;AAEvE;;GAEG;AACH,QAAA,MAAM,cAAc;;4BAElB,CAAC;AAEH;;GAEG;AACH,QAAA,MAAM,aAAa;;4BAEjB,CAAC;AAEH;;GAEG;AACH,QAAA,MAAM,eAAe;;yBAEnB,CAAC;AAEH,QAAA,MAAM,MAAM,qLAMD,CAAC;AAEZ,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,UAAU,EACV,wBAAwB,EACxB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,MAAM,EACN,mBAAmB,EACnB,4BAA4B,EAC5B,+BAA+B,EAC/B,4BAA4B,EAC5B,yBAAyB,EACzB,wBAAwB,EACxB,QAAQ,EACR,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import type { RuleContext, RuleListener, RuleMetaData, RuleMetaDataDocs, RuleModule } from '../ts-eslint/Rule';
2
2
  export type NamedCreateRuleMetaDocs = Omit<RuleMetaDataDocs, 'url'>;
3
- export type NamedCreateRuleMeta<TMessageIds extends string> = {
3
+ export type NamedCreateRuleMeta<TMessageIds extends string> = Omit<RuleMetaData<TMessageIds>, 'docs'> & {
4
4
  docs: NamedCreateRuleMetaDocs;
5
- } & Omit<RuleMetaData<TMessageIds>, 'docs'>;
5
+ };
6
6
  export interface RuleCreateAndOptions<TOptions extends readonly unknown[], TMessageIds extends string> {
7
7
  create: (context: Readonly<RuleContext<TMessageIds, TOptions>>, optionsWithDefault: Readonly<TOptions>) => RuleListener;
8
8
  defaultOptions: Readonly<TOptions>;
@@ -1 +1 @@
1
- {"version":3,"file":"RuleCreator.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/RuleCreator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACX,MAAM,mBAAmB,CAAC;AAI3B,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,WAAW,CAAC,WAAW,GAAG,UAAU,CAAC"}
1
+ {"version":3,"file":"RuleCreator.js","sourceRoot":"","sources":["../../src/eslint-utils/RuleCreator.ts"],"names":[],"mappings":";;;AAOA,iDAA8C;AAqC9C;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,UAAwC;IAClE,oHAAoH;IACpH,2FAA2F;IAC3F,OAAO,SAAS,eAAe,CAG7B,EACA,IAAI,EACJ,IAAI,EACJ,GAAG,IAAI,EAC8C;QAIrD,OAAO,UAAU,CAAwB;YACvC,IAAI,EAAE;gBACJ,GAAG,IAAI;gBACP,IAAI,EAAE;oBACJ,GAAG,IAAI,CAAC,IAAI;oBACZ,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC;iBACtB;aACF;YACD,GAAG,IAAI;SACR,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAzBD,kCAyBC;AAED;;;;;GAKG;AACH,SAAS,UAAU,CAGjB,EACA,MAAM,EACN,cAAc,EACd,IAAI,GAC0C;IAI9C,OAAO;QACL,MAAM,CACJ,OAAqD;YAErD,MAAM,kBAAkB,GAAG,IAAA,2BAAY,EAAC,cAAc,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YACzE,OAAO,MAAM,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAC7C,CAAC;QACD,cAAc;QACd,IAAI;KACL,CAAC;AACJ,CAAC;AAED,WAAW,CAAC,WAAW,GAAG,UAAU,CAAC"}
@@ -4,7 +4,7 @@ type ObjectLike<T = unknown> = Record<string, T>;
4
4
  * @param obj an object
5
5
  * @returns `true` if obj is an object
6
6
  */
7
- declare function isObjectNotArray<T extends ObjectLike>(obj: unknown | unknown[]): obj is T;
7
+ declare function isObjectNotArray<T extends ObjectLike>(obj: unknown): obj is T;
8
8
  /**
9
9
  * Pure function - doesn't mutate either parameter!
10
10
  * Merges two objects together deeply, overwriting the properties in first with the properties in second
@@ -1 +1 @@
1
- {"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/deepMerge.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,CAAC,CAAC,GAAG,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAEjD;;;;GAIG;AACH,iBAAS,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAC5C,GAAG,EAAE,OAAO,GAAG,OAAO,EAAE,GACvB,GAAG,IAAI,CAAC,CAEV;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,KAAK,GAAE,UAAe,EACtB,MAAM,GAAE,UAAe,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0BzB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/deepMerge.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,CAAC,CAAC,GAAG,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAEjD;;;;GAIG;AACH,iBAAS,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAAE,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,CAAC,CAEtE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,KAAK,GAAE,UAAe,EACtB,MAAM,GAAE,UAAe,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0BzB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"deepMerge.js","sourceRoot":"","sources":["../../src/eslint-utils/deepMerge.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,SAAS,gBAAgB,CACvB,GAAwB;IAExB,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACxD,CAAC;AAwCQ,4CAAgB;AAtCzB;;;;;;GAMG;AACH,SAAgB,SAAS,CACvB,QAAoB,E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CAAC;AACxD,CAAC;AAwCQ,4CAAgB;AAtCzB;;;;;;GAMG;AACH,SAAgB,SAAS,CACvB,QAAoB,EAAE,EACtB,SAAqB,EAAE;IAEvB,iDAAiD;IACjD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAErE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAa,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACtD,MAAM,WAAW,GAAG,GAAG,IAAI,KAAK,CAAC;QACjC,MAAM,YAAY,GAAG,GAAG,IAAI,MAAM,CAAC;QACnC,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAEhC,IAAI,WAAW,IAAI,YAAY,EAAE;YAC/B,IAAI,gBAAgB,CAAC,UAAU,CAAC,IAAI,gBAAgB,CAAC,WAAW,CAAC,EAAE;gBACjE,cAAc;gBACd,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;aAC/C;iBAAM;gBACL,aAAa;gBACb,GAAG,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;aACxB;SACF;aAAM,IAAI,WAAW,EAAE;YACtB,GAAG,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;SACvB;aAAM;YACL,GAAG,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;SACxB;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AA7BD,8BA6BC"}
@@ -1,9 +1,24 @@
1
1
  import type * as TSESLint from '../ts-eslint';
2
2
  import type { ParserServices, ParserServicesWithTypeInformation } from '../ts-estree';
3
- type GetParserServicesResult<T extends boolean> = T extends true ? ParserServices : ParserServicesWithTypeInformation;
4
3
  /**
5
- * Try to retrieve typescript parser service from context
4
+ * Try to retrieve type-aware parser service from context.
5
+ * This **_will_** throw if it is not available.
6
6
  */
7
- declare function getParserServices<TMessageIds extends string, TOptions extends readonly unknown[], TAllowWithoutFullTypeInformation extends boolean = false>(context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>, allowWithoutFullTypeInformation?: TAllowWithoutFullTypeInformation): GetParserServicesResult<TAllowWithoutFullTypeInformation>;
7
+ declare function getParserServices<TMessageIds extends string, TOptions extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>): ParserServicesWithTypeInformation;
8
+ /**
9
+ * Try to retrieve type-aware parser service from context.
10
+ * This **_will_** throw if it is not available.
11
+ */
12
+ declare function getParserServices<TMessageIds extends string, TOptions extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>, allowWithoutFullTypeInformation: false): ParserServicesWithTypeInformation;
13
+ /**
14
+ * Try to retrieve type-aware parser service from context.
15
+ * This **_will not_** throw if it is not available.
16
+ */
17
+ declare function getParserServices<TMessageIds extends string, TOptions extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>, allowWithoutFullTypeInformation: true): ParserServices;
18
+ /**
19
+ * Try to retrieve type-aware parser service from context.
20
+ * This may or may not throw if it is not available, depending on if `allowWithoutFullTypeInformation` is `true`
21
+ */
22
+ declare function getParserServices<TMessageIds extends string, TOptions extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>, allowWithoutFullTypeInformation: boolean): ParserServices;
8
23
  export { getParserServices };
9
24
  //# sourceMappingURL=getParserServices.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getParserServices.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/getParserServices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EACV,cAAc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