mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2026-05-09 21:14:07 +08:00
fix: type error & lint
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
packages:
|
||||
- packages/*
|
||||
allowBuilds:
|
||||
esbuild: set this to true or false
|
||||
|
||||
catalog:
|
||||
vue: ^3.5.33
|
||||
|
||||
allowBuilds:
|
||||
esbuild: false
|
||||
|
||||
trustPolicy: no-downgrade
|
||||
trustPolicyIgnoreAfter: 604800 # 7 days
|
||||
|
||||
@@ -3,7 +3,7 @@ import { defineConfig } from 'vitest/config'
|
||||
import Jsx from './packages/babel-plugin-jsx/src'
|
||||
|
||||
export default defineConfig({
|
||||
esbuild: {
|
||||
oxc: {
|
||||
jsx: 'preserve',
|
||||
},
|
||||
plugins: [
|
||||
|
||||
Reference in New Issue
Block a user