[autofix.ci] apply automated fixes
This commit is contained in:
parent
95892900a2
commit
e51c358f73
|
@ -10,10 +10,10 @@ import { isCallOf } from './utils'
|
||||||
import type { ScriptCompileContext } from './context'
|
import type { ScriptCompileContext } from './context'
|
||||||
import {
|
import {
|
||||||
type TypeResolveContext,
|
type TypeResolveContext,
|
||||||
resolveTypeElements,
|
|
||||||
resolveUnionType,
|
|
||||||
resolveTypeReference,
|
|
||||||
resolveEnumMemberValue,
|
resolveEnumMemberValue,
|
||||||
|
resolveTypeElements,
|
||||||
|
resolveTypeReference,
|
||||||
|
resolveUnionType,
|
||||||
} from './resolveType'
|
} from './resolveType'
|
||||||
|
|
||||||
export const DEFINE_EMITS = 'defineEmits'
|
export const DEFINE_EMITS = 'defineEmits'
|
||||||
|
@ -133,7 +133,7 @@ function extractEventNames(
|
||||||
const memberValue = resolveEnumMemberValue(
|
const memberValue = resolveEnumMemberValue(
|
||||||
ctx,
|
ctx,
|
||||||
type,
|
type,
|
||||||
typeNode.typeName.right.name
|
typeNode.typeName.right.name,
|
||||||
)
|
)
|
||||||
if (memberValue) emits.add(memberValue)
|
if (memberValue) emits.add(memberValue)
|
||||||
}
|
}
|
||||||
|
@ -146,13 +146,13 @@ function extractEventNames(
|
||||||
ctx,
|
ctx,
|
||||||
type,
|
type,
|
||||||
undefined,
|
undefined,
|
||||||
type.typeName.left.name
|
type.typeName.left.name,
|
||||||
)
|
)
|
||||||
if (resolved && resolved.type === 'TSEnumDeclaration') {
|
if (resolved && resolved.type === 'TSEnumDeclaration') {
|
||||||
const memberValue = resolveEnumMemberValue(
|
const memberValue = resolveEnumMemberValue(
|
||||||
ctx,
|
ctx,
|
||||||
resolved,
|
resolved,
|
||||||
type.typeName.right.name
|
type.typeName.right.name,
|
||||||
)
|
)
|
||||||
if (memberValue) emits.add(memberValue)
|
if (memberValue) emits.add(memberValue)
|
||||||
}
|
}
|
||||||
|
|
|
@ -765,7 +765,7 @@ function innerResolveTypeReference(
|
||||||
scope,
|
scope,
|
||||||
name[0],
|
name[0],
|
||||||
node,
|
node,
|
||||||
onlyExported
|
onlyExported,
|
||||||
)
|
)
|
||||||
if (resolved) {
|
if (resolved) {
|
||||||
if (resolved.type === 'TSEnumDeclaration') {
|
if (resolved.type === 'TSEnumDeclaration') {
|
||||||
|
@ -779,14 +779,14 @@ function innerResolveTypeReference(
|
||||||
const childScope = moduleDeclToScope(
|
const childScope = moduleDeclToScope(
|
||||||
ctx,
|
ctx,
|
||||||
resolved,
|
resolved,
|
||||||
resolved._ownerScope || scope
|
resolved._ownerScope || scope,
|
||||||
)
|
)
|
||||||
return innerResolveTypeReference(
|
return innerResolveTypeReference(
|
||||||
ctx,
|
ctx,
|
||||||
childScope,
|
childScope,
|
||||||
name.length > 2 ? name.slice(1) : name[name.length - 1],
|
name.length > 2 ? name.slice(1) : name[name.length - 1],
|
||||||
node,
|
node,
|
||||||
!resolved.declare
|
!resolved.declare,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1963,7 +1963,7 @@ export function resolveEnumMemberValue(
|
||||||
ctx: TypeResolveContext,
|
ctx: TypeResolveContext,
|
||||||
node: Node & MaybeWithScope & { _resolvedElements?: ResolvedElements },
|
node: Node & MaybeWithScope & { _resolvedElements?: ResolvedElements },
|
||||||
typeName: string,
|
typeName: string,
|
||||||
scope?: TypeScope
|
scope?: TypeScope,
|
||||||
): string | undefined {
|
): string | undefined {
|
||||||
if (node.type === 'TSTypeReference') {
|
if (node.type === 'TSTypeReference') {
|
||||||
const resolved = resolveTypeReference(ctx, node, scope, typeName)
|
const resolved = resolveTypeReference(ctx, node, scope, typeName)
|
||||||
|
@ -1990,7 +1990,7 @@ export function resolveEnumMemberValue(
|
||||||
ctx,
|
ctx,
|
||||||
m.initializer.object,
|
m.initializer.object,
|
||||||
m.initializer.property.name,
|
m.initializer.property.name,
|
||||||
scope
|
scope,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue