corsa-oxlint 0.8.0 → 0.10.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 (81) hide show
  1. package/README.md +10 -30
  2. package/dist/ast_utils.d.ts +466 -4
  3. package/dist/ast_utils.js +1010 -5
  4. package/dist/ast_utils.js.map +1 -1
  5. package/dist/checker.js +5 -2
  6. package/dist/checker.js.map +1 -1
  7. package/dist/compat.d.ts +188 -2
  8. package/dist/compat.js +95 -2
  9. package/dist/compat.js.map +1 -1
  10. package/dist/index.d.ts +4 -2
  11. package/dist/index.js +4 -2
  12. package/dist/oxlint_utils.d.ts +32 -3
  13. package/dist/oxlint_utils.js +35 -8
  14. package/dist/oxlint_utils.js.map +1 -1
  15. package/dist/rules/await_thenable.js +8 -1
  16. package/dist/rules/await_thenable.js.map +1 -1
  17. package/dist/rules/index.d.ts +1106 -146
  18. package/dist/rules/index.js +67 -21
  19. package/dist/rules/index.js.map +1 -1
  20. package/dist/rules/native_bridge.d.ts +10 -2
  21. package/dist/rules/native_bridge.js +347 -11
  22. package/dist/rules/native_bridge.js.map +1 -1
  23. package/dist/rules/no_array_delete.js +9 -1
  24. package/dist/rules/no_array_delete.js.map +1 -1
  25. package/dist/rules/no_base_to_string.js +16 -59
  26. package/dist/rules/no_base_to_string.js.map +1 -1
  27. package/dist/rules/no_floating_promises.js +12 -35
  28. package/dist/rules/no_floating_promises.js.map +1 -1
  29. package/dist/rules/no_for_in_array.js +5 -1
  30. package/dist/rules/no_for_in_array.js.map +1 -1
  31. package/dist/rules/no_implied_eval.js +23 -1
  32. package/dist/rules/no_implied_eval.js.map +1 -1
  33. package/dist/rules/no_meaningless_void_operator.d.ts +16 -0
  34. package/dist/rules/no_meaningless_void_operator.js +18 -0
  35. package/dist/rules/no_meaningless_void_operator.js.map +1 -0
  36. package/dist/rules/no_unsafe_assignment.js +13 -34
  37. package/dist/rules/no_unsafe_assignment.js.map +1 -1
  38. package/dist/rules/no_unsafe_call.d.ts +16 -0
  39. package/dist/rules/no_unsafe_call.js +16 -0
  40. package/dist/rules/no_unsafe_call.js.map +1 -0
  41. package/dist/rules/no_unsafe_member_access.d.ts +16 -0
  42. package/dist/rules/no_unsafe_member_access.js +15 -0
  43. package/dist/rules/no_unsafe_member_access.js.map +1 -0
  44. package/dist/rules/no_unsafe_return.js +12 -49
  45. package/dist/rules/no_unsafe_return.js.map +1 -1
  46. package/dist/rules/no_unsafe_type_assertion.d.ts +16 -0
  47. package/dist/rules/no_unsafe_type_assertion.js +15 -0
  48. package/dist/rules/no_unsafe_type_assertion.js.map +1 -0
  49. package/dist/rules/no_unsafe_unary_minus.js +9 -1
  50. package/dist/rules/no_unsafe_unary_minus.js.map +1 -1
  51. package/dist/rules/only_throw_error.js +12 -1
  52. package/dist/rules/only_throw_error.js.map +1 -1
  53. package/dist/rules/pending_parity.d.ts +412 -0
  54. package/dist/rules/pending_parity.js +66 -0
  55. package/dist/rules/pending_parity.js.map +1 -0
  56. package/dist/rules/prefer_promise_reject_errors.js +20 -43
  57. package/dist/rules/prefer_promise_reject_errors.js.map +1 -1
  58. package/dist/rules/prefer_reduce_type_parameter.d.ts +16 -0
  59. package/dist/rules/prefer_reduce_type_parameter.js +20 -0
  60. package/dist/rules/prefer_reduce_type_parameter.js.map +1 -0
  61. package/dist/rules/prefer_string_starts_ends_with.js +2 -48
  62. package/dist/rules/prefer_string_starts_ends_with.js.map +1 -1
  63. package/dist/rules/require_array_sort_compare.js +10 -29
  64. package/dist/rules/require_array_sort_compare.js.map +1 -1
  65. package/dist/rules/restrict_plus_operands.js +12 -55
  66. package/dist/rules/restrict_plus_operands.js.map +1 -1
  67. package/dist/rules/restrict_template_expressions.d.ts +16 -0
  68. package/dist/rules/restrict_template_expressions.js +7 -0
  69. package/dist/rules/restrict_template_expressions.js.map +1 -0
  70. package/dist/rules/type_utils.js +29 -6
  71. package/dist/rules/type_utils.js.map +1 -1
  72. package/dist/session.d.ts +5 -2
  73. package/dist/session.js +67 -11
  74. package/dist/session.js.map +1 -1
  75. package/dist/ts_eslint.d.ts +41 -0
  76. package/dist/ts_eslint.js +28 -0
  77. package/dist/ts_eslint.js.map +1 -0
  78. package/dist/ts_utils.d.ts +10 -0
  79. package/dist/ts_utils.js +14 -0
  80. package/dist/ts_utils.js.map +1 -0
  81. package/package.json +19 -4
package/README.md CHANGED
@@ -12,6 +12,7 @@ plugins with real type information powered by `tsgo`.
12
12
  ## What It Does
13
13
 
14
14
  - exposes `OxlintUtils.RuleCreator()` and `getParserServices()` backed by `tsgo`
15
+ - exposes compatibility namespaces such as `ESLintUtils`, `TSESLint`, `TSESTree`, and `TSUtils`
15
16
  - keeps a compact self-hosted helper surface with no extra lint-framework dependency
16
17
  - binds Rust-implemented hot paths into JS through `napi-rs`
17
18
  - lets custom Oxlint rules query types and symbols from JS or TS
@@ -114,29 +115,10 @@ export default [
114
115
  ];
115
116
  ```
116
117
 
117
- Current native coverage includes:
118
-
119
- - `await-thenable`
120
- - `no-array-delete`
121
- - `no-base-to-string`
122
- - `no-floating-promises`
123
- - `no-for-in-array`
124
- - `no-implied-eval`
125
- - `no-mixed-enums`
126
- - `no-unsafe-assignment`
127
- - `no-unsafe-return`
128
- - `no-unsafe-unary-minus`
129
- - `only-throw-error`
130
- - `prefer-find`
131
- - `prefer-includes`
132
- - `prefer-promise-reject-errors`
133
- - `prefer-regexp-exec`
134
- - `prefer-string-starts-ends-with`
135
- - `require-array-sort-compare`
136
- - `restrict-plus-operands`
137
- - `use-unknown-in-catch-callback-variable`
138
-
139
- The remaining upstream rules stay listed in `pendingNativeRuleNames`, and
118
+ Current native coverage is exported from `implementedNativeRuleNames`. It now
119
+ covers the tracked upstream `tsgolint/internal/rules` surface, including the
120
+ unsafe, unnecessary, promise/control-flow, preference/style, and type/export
121
+ families. `pendingNativeRuleNames` is intentionally empty, and
140
122
  `native_rules.test.ts` fails if implemented + pending drift away from the
141
123
  tracked upstream rule list.
142
124
 
@@ -151,13 +133,10 @@ as Oxlint JS plugin rules. The bridge is:
151
133
  4. Rust returns Oxlint-shaped diagnostics, suggestions, and fixes.
152
134
  5. The JS rule reports them through `context.report()`.
153
135
 
154
- The first rules on this path are `await-thenable`, `no-array-delete`,
155
- `no-for-in-array`, `no-implied-eval`, `no-mixed-enums`,
156
- `no-unsafe-unary-minus`, `only-throw-error`, `prefer-find`,
157
- `prefer-includes`, `prefer-regexp-exec`, and
158
- `use-unknown-in-catch-callback-variable`. Custom project-specific rules can
159
- still be authored in JS/TS with `OxlintUtils.RuleCreator()`, while hot,
160
- shared, tsgolint-parity rules can move into Rust incrementally.
136
+ The built-in tsgolint parity rules are registered through
137
+ `corsa::lint::RustLintRule`. Custom project-specific rules can still be
138
+ authored in JS/TS with `OxlintUtils.RuleCreator()`, while hot, shared rules can
139
+ continue to move deeper into compact Rust facts as the bridge grows.
161
140
 
162
141
  ## Runtime Safety Controls
163
142
 
@@ -183,6 +162,7 @@ vp check
183
162
  vp test run --config ./vite.config.ts src/bindings/nodejs/typescript_oxlint/ts/**/*.test.ts
184
163
  vp test bench --config ./vite.config.ts bench/src/typescript_oxlint.bench.ts
185
164
  vp test bench --config ./vite.config.ts bench/src/typescript_oxlint_rules.bench.ts
165
+ vp run -w bench_tooling_compare
186
166
  ```
187
167
 
188
168
  Repository-level examples live under [`examples/`](../../examples/README.md),
@@ -1,17 +1,479 @@
1
1
  declare namespace ast_utils_d_exports {
2
- export { ASTUtils, isIdentifier, isNodeOfType };
2
+ export { ASTUtils, LINEBREAK_MATCHER, PatternMatcher, ReferenceTracker, findVariable, getFunctionHeadLocation, getFunctionNameWithKind, getInnermostScope, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isArrowToken, isAwaitExpression, isAwaitKeyword, isClassOrTypeElement, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isConstructor, isFunction, isFunctionOrFunctionType, isFunctionType, isIdentifier, isImportKeyword, isLogicalOrOperator, isLoop, isNodeOfType, isNodeOfTypeWithConditions, isNodeOfTypes, isNonNullAssertionPunctuator, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotNonNullAssertionPunctuator, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotOptionalChainPunctuator, isNotSemicolonToken, isNotTokenOfTypeWithConditions, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isOptionalCallExpression, isOptionalChainPunctuator, isParenthesized, isSemicolonToken, isSetter, isTSConstructorType, isTSFunctionType, isTokenOfTypeWithConditions, isTokenOnSameLine, isTypeAssertion, isTypeKeyword, isVariableDeclarator };
3
3
  }
4
- declare function isNodeOfType(node: {
4
+ type TypedValue = {
5
5
  readonly type?: string;
6
- } | null | undefined, type: string): boolean;
6
+ };
7
+ type ValueToken = {
8
+ readonly type?: string;
9
+ readonly value?: string;
10
+ };
11
+ type Predicate<T> = (value: T | null | undefined) => boolean;
12
+ type AstNode = Record<string, unknown> & {
13
+ readonly name?: string;
14
+ readonly range?: readonly [number, number];
15
+ readonly type?: string;
16
+ };
17
+ type StaticValue = {
18
+ readonly value: unknown;
19
+ } | null;
20
+ type Position = {
21
+ readonly line: number;
22
+ readonly column: number;
23
+ };
24
+ type SourceLocation = {
25
+ readonly start: Position;
26
+ readonly end: Position;
27
+ };
28
+ type TokenLike = {
29
+ readonly type?: string;
30
+ readonly value?: string;
31
+ readonly loc?: SourceLocation;
32
+ };
33
+ type SourceCodeLike = {
34
+ readonly visitorKeys?: Readonly<Record<string, readonly string[]>>;
35
+ getFirstToken?: (node: unknown, predicate?: (token: TokenLike) => boolean) => TokenLike | null;
36
+ getText?: (node: unknown) => string;
37
+ getTokenAfter?: (node: unknown, predicate?: (token: TokenLike) => boolean) => TokenLike | null;
38
+ getTokenBefore?: (node: unknown, predicate?: (token: TokenLike) => boolean) => TokenLike | null;
39
+ };
40
+ type ScopeLike = {
41
+ readonly block?: AstNode & {
42
+ readonly range?: readonly [number, number];
43
+ };
44
+ readonly childScopes?: readonly ScopeLike[];
45
+ readonly set?: ReadonlyMap<string, VariableLike>;
46
+ readonly upper?: ScopeLike | null;
47
+ };
48
+ type HasSideEffectOptions = {
49
+ readonly considerGetters?: boolean;
50
+ readonly considerImplicitTypeConversion?: boolean;
51
+ };
52
+ type ReferenceLike = {
53
+ readonly identifier?: AstNode;
54
+ isRead?: () => boolean;
55
+ isWrite?: () => boolean;
56
+ };
57
+ type VariableLike = {
58
+ readonly defs?: readonly unknown[];
59
+ readonly references?: readonly ReferenceLike[];
60
+ };
61
+ type TraceMapValue<T> = TraceMapElement<T> | T | true | undefined;
62
+ interface TraceMapElement<T = never> {
63
+ readonly [key: string]: TraceMapValue<T>;
64
+ readonly [key: number]: TraceMapValue<T>;
65
+ [ReferenceTracker.READ]?: T;
66
+ [ReferenceTracker.CALL]?: T;
67
+ [ReferenceTracker.CONSTRUCT]?: T;
68
+ [ReferenceTracker.ESM]?: true;
69
+ }
70
+ type FoundReference<T = unknown> = {
71
+ info: T;
72
+ node: AstNode;
73
+ path: string[];
74
+ type: ReferenceTracker.ReferenceType;
75
+ };
76
+ declare function isNodeOfType(type: string): Predicate<TypedValue>;
77
+ declare function isNodeOfType(node: TypedValue | null | undefined, type: string): boolean;
78
+ declare function isNodeOfTypes(types: readonly string[]): Predicate<TypedValue>;
79
+ declare function isNodeOfTypes(node: TypedValue | null | undefined, types: readonly string[]): boolean;
80
+ declare function isNodeOfTypeWithConditions(type: string, conditions: Readonly<Record<string, unknown>>): Predicate<TypedValue>;
81
+ declare function isNodeOfTypeWithConditions(node: TypedValue | null | undefined, type: string, conditions: Readonly<Record<string, unknown>>): boolean;
7
82
  declare function isIdentifier(node: {
8
83
  readonly type?: string;
9
84
  readonly name?: string;
10
85
  } | null | undefined, name?: string): boolean;
86
+ declare function isTokenOfTypeWithConditions(type: string, conditions: Readonly<Record<string, unknown>>): Predicate<ValueToken>;
87
+ declare function isTokenOfTypeWithConditions(token: ValueToken | null | undefined, type: string, conditions: Readonly<Record<string, unknown>>): boolean;
88
+ declare function isNotTokenOfTypeWithConditions(type: string, conditions: Readonly<Record<string, unknown>>): Predicate<ValueToken>;
89
+ declare function isNotTokenOfTypeWithConditions(token: ValueToken | null | undefined, type: string, conditions: Readonly<Record<string, unknown>>): boolean;
90
+ declare function isFunction(node: {
91
+ readonly type?: string;
92
+ } | null | undefined): boolean;
93
+ declare function isFunctionType(node: {
94
+ readonly type?: string;
95
+ } | null | undefined): boolean;
96
+ declare function isFunctionOrFunctionType(node: {
97
+ readonly type?: string;
98
+ } | null | undefined): boolean;
99
+ declare function isTSFunctionType(node: {
100
+ readonly type?: string;
101
+ } | null | undefined): boolean;
102
+ declare function isTSConstructorType(node: {
103
+ readonly type?: string;
104
+ } | null | undefined): boolean;
105
+ declare function isAwaitExpression(node: {
106
+ readonly type?: string;
107
+ } | null | undefined): boolean;
108
+ declare function isVariableDeclarator(node: {
109
+ readonly type?: string;
110
+ } | null | undefined): boolean;
111
+ declare function isLoop(node: {
112
+ readonly type?: string;
113
+ } | null | undefined): boolean;
114
+ declare function isTypeAssertion(node: {
115
+ readonly type?: string;
116
+ } | null | undefined): boolean;
117
+ declare function isClassOrTypeElement(node: {
118
+ readonly type?: string;
119
+ } | null | undefined): boolean;
120
+ declare function isOptionalCallExpression(node: {
121
+ readonly type?: string;
122
+ readonly optional?: boolean;
123
+ } | null | undefined): boolean;
124
+ declare function isConstructor(node: {
125
+ readonly type?: string;
126
+ readonly kind?: string;
127
+ } | null | undefined): boolean;
128
+ declare function isSetter(node: {
129
+ readonly type?: string;
130
+ readonly kind?: string;
131
+ } | null | undefined): boolean;
132
+ declare const LINEBREAK_MATCHER: RegExp;
133
+ declare const isArrowToken: (token: {
134
+ readonly type?: string;
135
+ readonly value?: string;
136
+ } | null | undefined) => boolean;
137
+ declare const isNotArrowToken: (token: {
138
+ readonly type?: string;
139
+ readonly value?: string;
140
+ } | null | undefined) => boolean;
141
+ declare const isAwaitKeyword: (token: {
142
+ readonly type?: string;
143
+ readonly value?: string;
144
+ } | null | undefined) => boolean;
145
+ declare const isClosingBraceToken: (token: {
146
+ readonly type?: string;
147
+ readonly value?: string;
148
+ } | null | undefined) => boolean;
149
+ declare const isNotClosingBraceToken: (token: {
150
+ readonly type?: string;
151
+ readonly value?: string;
152
+ } | null | undefined) => boolean;
153
+ declare const isClosingBracketToken: (token: {
154
+ readonly type?: string;
155
+ readonly value?: string;
156
+ } | null | undefined) => boolean;
157
+ declare const isNotClosingBracketToken: (token: {
158
+ readonly type?: string;
159
+ readonly value?: string;
160
+ } | null | undefined) => boolean;
161
+ declare const isClosingParenToken: (token: {
162
+ readonly type?: string;
163
+ readonly value?: string;
164
+ } | null | undefined) => boolean;
165
+ declare const isNotClosingParenToken: (token: {
166
+ readonly type?: string;
167
+ readonly value?: string;
168
+ } | null | undefined) => boolean;
169
+ declare const isColonToken: (token: {
170
+ readonly type?: string;
171
+ readonly value?: string;
172
+ } | null | undefined) => boolean;
173
+ declare const isNotColonToken: (token: {
174
+ readonly type?: string;
175
+ readonly value?: string;
176
+ } | null | undefined) => boolean;
177
+ declare const isCommaToken: (token: {
178
+ readonly type?: string;
179
+ readonly value?: string;
180
+ } | null | undefined) => boolean;
181
+ declare const isNotCommaToken: (token: {
182
+ readonly type?: string;
183
+ readonly value?: string;
184
+ } | null | undefined) => boolean;
185
+ declare const isCommentToken: (token: {
186
+ readonly type?: string;
187
+ } | null | undefined) => boolean;
188
+ declare const isNotCommentToken: (token: {
189
+ readonly type?: string;
190
+ } | null | undefined) => boolean;
191
+ declare const isImportKeyword: (token: {
192
+ readonly type?: string;
193
+ readonly value?: string;
194
+ } | null | undefined) => boolean;
195
+ declare const isLogicalOrOperator: (token: {
196
+ readonly type?: string;
197
+ readonly value?: string;
198
+ } | null | undefined) => boolean;
199
+ declare const isNonNullAssertionPunctuator: (token: {
200
+ readonly type?: string;
201
+ readonly value?: string;
202
+ } | null | undefined) => boolean;
203
+ declare const isNotNonNullAssertionPunctuator: (token: {
204
+ readonly type?: string;
205
+ readonly value?: string;
206
+ } | null | undefined) => boolean;
207
+ declare const isOpeningBraceToken: (token: {
208
+ readonly type?: string;
209
+ readonly value?: string;
210
+ } | null | undefined) => boolean;
211
+ declare const isNotOpeningBraceToken: (token: {
212
+ readonly type?: string;
213
+ readonly value?: string;
214
+ } | null | undefined) => boolean;
215
+ declare const isOpeningBracketToken: (token: {
216
+ readonly type?: string;
217
+ readonly value?: string;
218
+ } | null | undefined) => boolean;
219
+ declare const isNotOpeningBracketToken: (token: {
220
+ readonly type?: string;
221
+ readonly value?: string;
222
+ } | null | undefined) => boolean;
223
+ declare const isOpeningParenToken: (token: {
224
+ readonly type?: string;
225
+ readonly value?: string;
226
+ } | null | undefined) => boolean;
227
+ declare const isNotOpeningParenToken: (token: {
228
+ readonly type?: string;
229
+ readonly value?: string;
230
+ } | null | undefined) => boolean;
231
+ declare const isOptionalChainPunctuator: (token: {
232
+ readonly type?: string;
233
+ readonly value?: string;
234
+ } | null | undefined) => boolean;
235
+ declare const isNotOptionalChainPunctuator: (token: {
236
+ readonly type?: string;
237
+ readonly value?: string;
238
+ } | null | undefined) => boolean;
239
+ declare const isSemicolonToken: (token: {
240
+ readonly type?: string;
241
+ readonly value?: string;
242
+ } | null | undefined) => boolean;
243
+ declare const isNotSemicolonToken: (token: {
244
+ readonly type?: string;
245
+ readonly value?: string;
246
+ } | null | undefined) => boolean;
247
+ declare const isTypeKeyword: (token: {
248
+ readonly type?: string;
249
+ readonly value?: string;
250
+ } | null | undefined) => boolean;
251
+ declare function isTokenOnSameLine(left: {
252
+ readonly loc?: {
253
+ readonly end?: {
254
+ readonly line?: number;
255
+ };
256
+ };
257
+ }, right: {
258
+ readonly loc?: {
259
+ readonly start?: {
260
+ readonly line?: number;
261
+ };
262
+ };
263
+ }): boolean;
264
+ declare function isParenthesized(node: {
265
+ readonly range?: readonly [number, number];
266
+ }, sourceCode?: {
267
+ getTokenBefore?: (node: unknown) => {
268
+ readonly value?: string;
269
+ } | null;
270
+ getTokenAfter?: (node: unknown) => {
271
+ readonly value?: string;
272
+ } | null;
273
+ }): boolean;
274
+ declare function getInnermostScope(initialScope: ScopeLike | null | undefined, node: {
275
+ readonly range?: readonly [number, number];
276
+ } | null | undefined): ScopeLike | null;
277
+ declare function findVariable(initialScope: ScopeLike | null | undefined, nameOrNode: string | ({
278
+ readonly name?: string;
279
+ } & {
280
+ readonly range?: readonly [number, number];
281
+ })): VariableLike | null;
282
+ declare function getFunctionHeadLocation(node: AstNode | null | undefined, sourceCode?: SourceCodeLike): SourceLocation | null;
283
+ declare function getFunctionNameWithKind(node: AstNode | null | undefined, sourceCode?: SourceCodeLike): string;
284
+ declare function getPropertyName(node: AstNode | null | undefined): string | null;
285
+ declare function getStaticValue(node: AstNode | null | undefined): StaticValue;
286
+ declare function getStringIfConstant(node: AstNode | null | undefined): string | null;
287
+ declare function hasSideEffect(node: AstNode | null | undefined, sourceCode?: SourceCodeLike, options?: HasSideEffectOptions): boolean;
288
+ declare class PatternMatcher {
289
+ constructor(pattern: RegExp, options?: {
290
+ readonly escaped?: boolean;
291
+ });
292
+ execAll(str: string): IterableIterator<RegExpExecArray>;
293
+ test(str: string): boolean;
294
+ [Symbol.replace](str: string, replacer: string | ((substring: string, ...args: unknown[]) => string)): string;
295
+ }
296
+ declare class ReferenceTracker {
297
+ #private;
298
+ static readonly READ: unique symbol;
299
+ static readonly CALL: unique symbol;
300
+ static readonly CONSTRUCT: unique symbol;
301
+ static readonly ESM: unique symbol;
302
+ constructor(globalScope: ScopeLike, options?: {
303
+ readonly globalObjectNames?: readonly string[];
304
+ readonly mode?: "legacy" | "strict";
305
+ });
306
+ iterateGlobalReferences<T>(traceMap: TraceMapElement<T>): IterableIterator<FoundReference<T>>;
307
+ iterateCjsReferences<T>(traceMap: TraceMapElement<T>): IterableIterator<FoundReference<T>>;
308
+ iterateEsmReferences<T>(traceMap: TraceMapElement<T>): IterableIterator<FoundReference<T>>;
309
+ iteratePropertyReferences<T>(node: AstNode, traceMap: TraceMapElement<T>): IterableIterator<FoundReference<T>>;
310
+ }
311
+ declare namespace ReferenceTracker {
312
+ type READ = typeof ReferenceTracker.READ;
313
+ type CALL = typeof ReferenceTracker.CALL;
314
+ type CONSTRUCT = typeof ReferenceTracker.CONSTRUCT;
315
+ type ESM = typeof ReferenceTracker.ESM;
316
+ type ReferenceType = READ | CALL | CONSTRUCT;
317
+ type TraceMap<T = unknown> = TraceMapElement<T>;
318
+ type FoundReference<T = unknown> = {
319
+ info: T;
320
+ node: AstNode;
321
+ path: readonly string[];
322
+ type: ReferenceType;
323
+ };
324
+ }
11
325
  declare const ASTUtils: Readonly<{
326
+ LINEBREAK_MATCHER: RegExp;
327
+ PatternMatcher: typeof PatternMatcher;
328
+ ReferenceTracker: typeof ReferenceTracker;
329
+ findVariable: typeof findVariable;
330
+ getFunctionHeadLocation: typeof getFunctionHeadLocation;
331
+ getFunctionNameWithKind: typeof getFunctionNameWithKind;
332
+ getInnermostScope: typeof getInnermostScope;
333
+ getPropertyName: typeof getPropertyName;
334
+ getStaticValue: typeof getStaticValue;
335
+ getStringIfConstant: typeof getStringIfConstant;
336
+ hasSideEffect: typeof hasSideEffect;
12
337
  isIdentifier: typeof isIdentifier;
338
+ isArrowToken: (token: {
339
+ readonly type?: string;
340
+ readonly value?: string;
341
+ } | null | undefined) => boolean;
342
+ isAwaitExpression: typeof isAwaitExpression;
343
+ isAwaitKeyword: (token: {
344
+ readonly type?: string;
345
+ readonly value?: string;
346
+ } | null | undefined) => boolean;
347
+ isClosingBraceToken: (token: {
348
+ readonly type?: string;
349
+ readonly value?: string;
350
+ } | null | undefined) => boolean;
351
+ isClosingBracketToken: (token: {
352
+ readonly type?: string;
353
+ readonly value?: string;
354
+ } | null | undefined) => boolean;
355
+ isClosingParenToken: (token: {
356
+ readonly type?: string;
357
+ readonly value?: string;
358
+ } | null | undefined) => boolean;
359
+ isClassOrTypeElement: typeof isClassOrTypeElement;
360
+ isColonToken: (token: {
361
+ readonly type?: string;
362
+ readonly value?: string;
363
+ } | null | undefined) => boolean;
364
+ isCommaToken: (token: {
365
+ readonly type?: string;
366
+ readonly value?: string;
367
+ } | null | undefined) => boolean;
368
+ isCommentToken: (token: {
369
+ readonly type?: string;
370
+ } | null | undefined) => boolean;
371
+ isConstructor: typeof isConstructor;
372
+ isFunction: typeof isFunction;
373
+ isFunctionOrFunctionType: typeof isFunctionOrFunctionType;
374
+ isFunctionType: typeof isFunctionType;
375
+ isImportKeyword: (token: {
376
+ readonly type?: string;
377
+ readonly value?: string;
378
+ } | null | undefined) => boolean;
379
+ isLogicalOrOperator: (token: {
380
+ readonly type?: string;
381
+ readonly value?: string;
382
+ } | null | undefined) => boolean;
383
+ isLoop: typeof isLoop;
13
384
  isNodeOfType: typeof isNodeOfType;
385
+ isNodeOfTypes: typeof isNodeOfTypes;
386
+ isNodeOfTypeWithConditions: typeof isNodeOfTypeWithConditions;
387
+ isNonNullAssertionPunctuator: (token: {
388
+ readonly type?: string;
389
+ readonly value?: string;
390
+ } | null | undefined) => boolean;
391
+ isNotArrowToken: (token: {
392
+ readonly type?: string;
393
+ readonly value?: string;
394
+ } | null | undefined) => boolean;
395
+ isNotClosingBraceToken: (token: {
396
+ readonly type?: string;
397
+ readonly value?: string;
398
+ } | null | undefined) => boolean;
399
+ isNotClosingBracketToken: (token: {
400
+ readonly type?: string;
401
+ readonly value?: string;
402
+ } | null | undefined) => boolean;
403
+ isNotClosingParenToken: (token: {
404
+ readonly type?: string;
405
+ readonly value?: string;
406
+ } | null | undefined) => boolean;
407
+ isNotColonToken: (token: {
408
+ readonly type?: string;
409
+ readonly value?: string;
410
+ } | null | undefined) => boolean;
411
+ isNotCommaToken: (token: {
412
+ readonly type?: string;
413
+ readonly value?: string;
414
+ } | null | undefined) => boolean;
415
+ isNotCommentToken: (token: {
416
+ readonly type?: string;
417
+ } | null | undefined) => boolean;
418
+ isNotNonNullAssertionPunctuator: (token: {
419
+ readonly type?: string;
420
+ readonly value?: string;
421
+ } | null | undefined) => boolean;
422
+ isNotOpeningBraceToken: (token: {
423
+ readonly type?: string;
424
+ readonly value?: string;
425
+ } | null | undefined) => boolean;
426
+ isNotOpeningBracketToken: (token: {
427
+ readonly type?: string;
428
+ readonly value?: string;
429
+ } | null | undefined) => boolean;
430
+ isNotOpeningParenToken: (token: {
431
+ readonly type?: string;
432
+ readonly value?: string;
433
+ } | null | undefined) => boolean;
434
+ isNotOptionalChainPunctuator: (token: {
435
+ readonly type?: string;
436
+ readonly value?: string;
437
+ } | null | undefined) => boolean;
438
+ isNotSemicolonToken: (token: {
439
+ readonly type?: string;
440
+ readonly value?: string;
441
+ } | null | undefined) => boolean;
442
+ isNotTokenOfTypeWithConditions: typeof isNotTokenOfTypeWithConditions;
443
+ isOpeningBraceToken: (token: {
444
+ readonly type?: string;
445
+ readonly value?: string;
446
+ } | null | undefined) => boolean;
447
+ isOpeningBracketToken: (token: {
448
+ readonly type?: string;
449
+ readonly value?: string;
450
+ } | null | undefined) => boolean;
451
+ isOpeningParenToken: (token: {
452
+ readonly type?: string;
453
+ readonly value?: string;
454
+ } | null | undefined) => boolean;
455
+ isOptionalCallExpression: typeof isOptionalCallExpression;
456
+ isOptionalChainPunctuator: (token: {
457
+ readonly type?: string;
458
+ readonly value?: string;
459
+ } | null | undefined) => boolean;
460
+ isParenthesized: typeof isParenthesized;
461
+ isSemicolonToken: (token: {
462
+ readonly type?: string;
463
+ readonly value?: string;
464
+ } | null | undefined) => boolean;
465
+ isSetter: typeof isSetter;
466
+ isTokenOfTypeWithConditions: typeof isTokenOfTypeWithConditions;
467
+ isTokenOnSameLine: typeof isTokenOnSameLine;
468
+ isTSConstructorType: typeof isTSConstructorType;
469
+ isTSFunctionType: typeof isTSFunctionType;
470
+ isTypeAssertion: typeof isTypeAssertion;
471
+ isTypeKeyword: (token: {
472
+ readonly type?: string;
473
+ readonly value?: string;
474
+ } | null | undefined) => boolean;
475
+ isVariableDeclarator: typeof isVariableDeclarator;
14
476
  }>;
15
477
  //#endregion
16
- export { ASTUtils, ast_utils_d_exports, isIdentifier, isNodeOfType };
478
+ export { ASTUtils, LINEBREAK_MATCHER, PatternMatcher, ReferenceTracker, ast_utils_d_exports, findVariable, getFunctionHeadLocation, getFunctionNameWithKind, getInnermostScope, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isArrowToken, isAwaitExpression, isAwaitKeyword, isClassOrTypeElement, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isConstructor, isFunction, isFunctionOrFunctionType, isFunctionType, isIdentifier, isImportKeyword, isLogicalOrOperator, isLoop, isNodeOfType, isNodeOfTypeWithConditions, isNodeOfTypes, isNonNullAssertionPunctuator, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotNonNullAssertionPunctuator, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotOptionalChainPunctuator, isNotSemicolonToken, isNotTokenOfTypeWithConditions, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isOptionalCallExpression, isOptionalChainPunctuator, isParenthesized, isSemicolonToken, isSetter, isTSConstructorType, isTSFunctionType, isTokenOfTypeWithConditions, isTokenOnSameLine, isTypeAssertion, isTypeKeyword, isVariableDeclarator };
17
479
  //# sourceMappingURL=ast_utils.d.ts.map