We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0203a7 commit 36afeb4Copy full SHA for 36afeb4
src/parser/typescript/index.ts
@@ -1,4 +1,5 @@
1
import type { ESLintExtendedProgram } from "..";
2
+import { traverseNodes } from "../..";
3
import type { NormalizedParserOptions } from "../parser-options";
4
import { parseScript, parseScriptInSvelte } from "../script";
5
import type { AnalyzeTypeScriptContext } from "./analyze";
@@ -33,6 +34,15 @@ export function parseTypeScript(
33
34
const tsCtx = analyzeTypeScript(code, attrs, parserOptions);
35
36
const result = parseScript(tsCtx.script, attrs, parserOptions);
37
+ traverseNodes(result.ast, {
38
+ visitorKeys: result.visitorKeys,
39
+ enterNode(node, parent) {
40
+ (node as any).parent = parent;
41
+ },
42
+ leaveNode() {
43
+ //
44
45
+ });
46
47
tsCtx.restoreContext.restore(result as unknown as TSESParseForESLintResult);
48
0 commit comments