File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 1
1
import type { ESLintExtendedProgram } from ".." ;
2
+ import { traverseNodes } from "../.." ;
2
3
import type { NormalizedParserOptions } from "../parser-options" ;
3
4
import { parseScript , parseScriptInSvelte } from "../script" ;
4
5
import type { AnalyzeTypeScriptContext } from "./analyze" ;
@@ -33,6 +34,15 @@ export function parseTypeScript(
33
34
const tsCtx = analyzeTypeScript ( code , attrs , parserOptions ) ;
34
35
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
+ } ) ;
36
46
37
47
tsCtx . restoreContext . restore ( result as unknown as TSESParseForESLintResult ) ;
38
48
You can’t perform that action at this time.
0 commit comments