fix: type error & lint

This commit is contained in:
Kevin Deng
2026-05-02 15:21:17 +09:00
parent 2ff807278e
commit e62d58051b
4 changed files with 25 additions and 4 deletions

View File

@@ -52,7 +52,6 @@ const parseDirectives = (params: {
let directiveArgument
let directiveModifiers
if ('namespace' in path.node.name) {
;[directiveName, directiveArgument] = params.name.split(':')
directiveName = path.node.name.namespace.name
directiveArgument = path.node.name.name.name
directiveModifiers = directiveArgument.split('_').slice(1)

View File

@@ -32,6 +32,23 @@ const plugin: (
options,
ast: file.ast.program.body,
isCE: false,
warn(msg, node) {
console.warn(
`[@vue/babel-plugin-resolve-type] ${msg}\n\n${filename}\n${codeFrameColumns(
file.code,
{
start: {
line: node.loc!.start.line,
column: node.loc!.start.column + 1,
},
end: {
line: node.loc!.end.line,
column: node.loc!.end.column + 1,
},
},
)}`,
)
},
error(msg, node) {
throw new Error(
`[@vue/babel-plugin-resolve-type] ${msg}\n\n${filename}\n${codeFrameColumns(