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 directiveArgument
let directiveModifiers let directiveModifiers
if ('namespace' in path.node.name) { if ('namespace' in path.node.name) {
;[directiveName, directiveArgument] = params.name.split(':')
directiveName = path.node.name.namespace.name directiveName = path.node.name.namespace.name
directiveArgument = path.node.name.name.name directiveArgument = path.node.name.name.name
directiveModifiers = directiveArgument.split('_').slice(1) directiveModifiers = directiveArgument.split('_').slice(1)

View File

@@ -32,6 +32,23 @@ const plugin: (
options, options,
ast: file.ast.program.body, ast: file.ast.program.body,
isCE: false, 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) { error(msg, node) {
throw new Error( throw new Error(
`[@vue/babel-plugin-resolve-type] ${msg}\n\n${filename}\n${codeFrameColumns( `[@vue/babel-plugin-resolve-type] ${msg}\n\n${filename}\n${codeFrameColumns(

View File

@@ -1,6 +1,11 @@
packages: packages:
- packages/* - packages/*
allowBuilds:
esbuild: set this to true or false
catalog: catalog:
vue: ^3.5.33 vue: ^3.5.33
allowBuilds:
esbuild: false
trustPolicy: no-downgrade
trustPolicyIgnoreAfter: 604800 # 7 days

View File

@@ -3,7 +3,7 @@ import { defineConfig } from 'vitest/config'
import Jsx from './packages/babel-plugin-jsx/src' import Jsx from './packages/babel-plugin-jsx/src'
export default defineConfig({ export default defineConfig({
esbuild: { oxc: {
jsx: 'preserve', jsx: 'preserve',
}, },
plugins: [ plugins: [