mirror of https://github.com/vuejs/core.git
chore: use moduleResolution: bundler + shim estree-walker
This commit is contained in:
parent
d2c3d8b70b
commit
ae7453f0f1
|
@ -32,7 +32,7 @@ export function walkIdentifiers(
|
||||||
root.body[0].type === 'ExpressionStatement' &&
|
root.body[0].type === 'ExpressionStatement' &&
|
||||||
root.body[0].expression
|
root.body[0].expression
|
||||||
|
|
||||||
;(walk as any)(root, {
|
walk(root, {
|
||||||
enter(node: Node & { scopeIds?: Set<string> }, parent: Node | undefined) {
|
enter(node: Node & { scopeIds?: Set<string> }, parent: Node | undefined) {
|
||||||
parent && parentStack.push(parent)
|
parent && parentStack.push(parent)
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -607,8 +607,8 @@ export function compileScript(
|
||||||
node.type.endsWith('Statement')
|
node.type.endsWith('Statement')
|
||||||
) {
|
) {
|
||||||
const scope: Statement[][] = [scriptSetupAst.body]
|
const scope: Statement[][] = [scriptSetupAst.body]
|
||||||
;(walk as any)(node, {
|
walk(node, {
|
||||||
enter(child: Node, parent: Node) {
|
enter(child: Node, parent: Node | undefined) {
|
||||||
if (isFunctionType(child)) {
|
if (isFunctionType(child)) {
|
||||||
this.skip()
|
this.skip()
|
||||||
}
|
}
|
||||||
|
@ -633,7 +633,7 @@ export function compileScript(
|
||||||
ctx,
|
ctx,
|
||||||
child,
|
child,
|
||||||
needsSemi,
|
needsSemi,
|
||||||
parent.type === 'ExpressionStatement'
|
parent!.type === 'ExpressionStatement'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -238,7 +238,7 @@ export function transformDestructuredProps(
|
||||||
// check root scope first
|
// check root scope first
|
||||||
const ast = ctx.scriptSetupAst!
|
const ast = ctx.scriptSetupAst!
|
||||||
walkScope(ast, true)
|
walkScope(ast, true)
|
||||||
;(walk as any)(ast, {
|
walk(ast, {
|
||||||
enter(node: Node, parent?: Node) {
|
enter(node: Node, parent?: Node) {
|
||||||
parent && parentStack.push(parent)
|
parent && parentStack.push(parent)
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,17 @@ declare module 'file-saver' {
|
||||||
export function saveAs(blob: any, name: any): void
|
export function saveAs(blob: any, name: any): void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare module 'estree-walker' {
|
||||||
|
export function walk<T>(
|
||||||
|
root: T,
|
||||||
|
options: {
|
||||||
|
enter?: (node: T, parent: T | undefined) => any
|
||||||
|
leave?: (node: T, parent: T | undefined) => any
|
||||||
|
exit?: (node: T) => any
|
||||||
|
} & ThisType<{ skip: () => void }>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
declare interface String {
|
declare interface String {
|
||||||
/**
|
/**
|
||||||
* @deprecated Please use String.prototype.slice instead of String.prototype.substring in the repository.
|
* @deprecated Please use String.prototype.slice instead of String.prototype.substring in the repository.
|
||||||
|
|
|
@ -636,7 +636,7 @@ export function transformAST(
|
||||||
|
|
||||||
// check root scope first
|
// check root scope first
|
||||||
walkScope(ast, true)
|
walkScope(ast, true)
|
||||||
;(walk as any)(ast, {
|
walk(ast, {
|
||||||
enter(node: Node, parent?: Node) {
|
enter(node: Node, parent?: Node) {
|
||||||
parent && parentStack.push(parent)
|
parent && parentStack.push(parent)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"newLine": "LF",
|
"newLine": "LF",
|
||||||
"useDefineForClassFields": false,
|
"useDefineForClassFields": false,
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "bundler",
|
||||||
"allowJs": false,
|
"allowJs": false,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
|
|
Loading…
Reference in New Issue