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 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)
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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: [
|
||||||
|
|||||||
Reference in New Issue
Block a user