File tree Expand file tree Collapse file tree 6 files changed +18
-7
lines changed Expand file tree Collapse file tree 6 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export function walkIdentifiers(
32
32
root . body [ 0 ] . type === 'ExpressionStatement' &&
33
33
root . body [ 0 ] . expression
34
34
35
- ; ( walk as any ) ( root , {
35
+ walk ( root , {
36
36
enter ( node : Node & { scopeIds ?: Set < string > } , parent : Node | undefined ) {
37
37
parent && parentStack . push ( parent )
38
38
if (
Original file line number Diff line number Diff line change @@ -607,8 +607,8 @@ export function compileScript(
607
607
node . type . endsWith ( 'Statement' )
608
608
) {
609
609
const scope : Statement [ ] [ ] = [ scriptSetupAst . body ]
610
- ; ( walk as any ) ( node , {
611
- enter ( child : Node , parent : Node ) {
610
+ walk ( node , {
611
+ enter ( child : Node , parent : Node | undefined ) {
612
612
if ( isFunctionType ( child ) ) {
613
613
this . skip ( )
614
614
}
@@ -633,7 +633,7 @@ export function compileScript(
633
633
ctx ,
634
634
child ,
635
635
needsSemi ,
636
- parent . type === 'ExpressionStatement'
636
+ parent ! . type === 'ExpressionStatement'
637
637
)
638
638
}
639
639
} ,
Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ export function transformDestructuredProps(
238
238
// check root scope first
239
239
const ast = ctx . scriptSetupAst !
240
240
walkScope ( ast , true )
241
- ; ( walk as any ) ( ast , {
241
+ walk ( ast , {
242
242
enter ( node : Node , parent ?: Node ) {
243
243
parent && parentStack . push ( parent )
244
244
Original file line number Diff line number Diff line change @@ -33,6 +33,17 @@ declare module 'file-saver' {
33
33
export function saveAs ( blob : any , name : any ) : void
34
34
}
35
35
36
+ declare module 'estree-walker' {
37
+ export function walk < T > (
38
+ root : T ,
39
+ options : {
40
+ enter ?: ( node : T , parent : T | undefined ) => any
41
+ leave ?: ( node : T , parent : T | undefined ) => any
42
+ exit ?: ( node : T ) => any
43
+ } & ThisType < { skip : ( ) => void } >
44
+ )
45
+ }
46
+
36
47
declare interface String {
37
48
/**
38
49
* @deprecated Please use String.prototype.slice instead of String.prototype.substring in the repository.
Original file line number Diff line number Diff line change @@ -636,7 +636,7 @@ export function transformAST(
636
636
637
637
// check root scope first
638
638
walkScope ( ast , true )
639
- ; ( walk as any ) ( ast , {
639
+ walk ( ast , {
640
640
enter ( node : Node , parent ?: Node ) {
641
641
parent && parentStack . push ( parent )
642
642
Original file line number Diff line number Diff line change 7
7
"newLine" : " LF" ,
8
8
"useDefineForClassFields" : false ,
9
9
"module" : " esnext" ,
10
- "moduleResolution" : " node " ,
10
+ "moduleResolution" : " bundler " ,
11
11
"allowJs" : false ,
12
12
"strict" : true ,
13
13
"noUnusedLocals" : true ,
You can’t perform that action at this time.
0 commit comments