revert: chore(deps): update dependency html-tags to v4 (#708)

This reverts commit 217b9229d6.
This commit is contained in:
三咲智子 Kevin Deng
2024-09-07 05:29:05 +08:00
parent 9ae4ecc6ba
commit 33305d0978
4 changed files with 10 additions and 12 deletions

View File

@ -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": {

View File

@ -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)