diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 896a47c..0d48fb7 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -14,4 +14,5 @@ enabled: false, }, ], + ignoreDeps: ['html-tags'], } diff --git a/packages/babel-plugin-jsx/package.json b/packages/babel-plugin-jsx/package.json index eedaecf..7e8348a 100644 --- a/packages/babel-plugin-jsx/package.json +++ b/packages/babel-plugin-jsx/package.json @@ -31,7 +31,7 @@ "@babel/types": "^7.25.6", "@vue/babel-helper-vue-transform-on": "workspace:*", "@vue/babel-plugin-resolve-type": "workspace:*", - "html-tags": "^4.0.0", + "html-tags": "^3.3.1", "svg-tags": "^1.0.0" }, "devDependencies": { diff --git a/packages/babel-plugin-jsx/src/utils.ts b/packages/babel-plugin-jsx/src/utils.ts index 704ed69..6e1d24d 100644 --- a/packages/babel-plugin-jsx/src/utils.ts +++ b/packages/babel-plugin-jsx/src/utils.ts @@ -1,5 +1,5 @@ import * as t from '@babel/types'; -import htmlTags, { type HtmlTags } from 'html-tags'; +import htmlTags from 'html-tags'; import svgTags from 'svg-tags'; import { type NodePath } from '@babel/traverse'; import type { State } from './interface'; @@ -60,7 +60,7 @@ export const checkIsComponent = ( return ( !state.opts.isCustomElement?.(tag) && shouldTransformedToSlots(tag) && - !htmlTags.includes(tag as HtmlTags) && + !htmlTags.includes(tag as htmlTags.htmlTags) && !svgTags.includes(tag) ); }; @@ -99,7 +99,10 @@ export const getTag = ( const namePath = path.get('openingElement').get('name'); if (namePath.isJSXIdentifier()) { const { name } = namePath.node; - if (!htmlTags.includes(name as HtmlTags) && !svgTags.includes(name)) { + if ( + !htmlTags.includes(name as htmlTags.htmlTags) && + !svgTags.includes(name) + ) { return name === FRAGMENT ? createIdentifier(state, FRAGMENT) : path.scope.hasBinding(name) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0a4f8ea..dbee2c0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -107,8 +107,8 @@ importers: specifier: workspace:* version: link:../babel-plugin-resolve-type html-tags: - specifier: ^4.0.0 - version: 4.0.0 + specifier: ^3.3.1 + version: 3.3.1 svg-tags: specifier: ^1.0.0 version: 1.0.0 @@ -2019,10 +2019,6 @@ packages: resolution: {integrity: sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==} engines: {node: '>=8'} - html-tags@4.0.0: - resolution: {integrity: sha512-KM1SNmemQtsD+OTInZTYKZNbyPzzVrjMR2Iz1Np+Y+bcxUh0dgKF4NtylJVkGZRLe3NklHizJ5k1Vd3ug1uTPA==} - engines: {node: '>=18.20'} - http-proxy-agent@7.0.2: resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} engines: {node: '>= 14'} @@ -5079,8 +5075,6 @@ snapshots: html-tags@3.3.1: {} - html-tags@4.0.0: {} - http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.1