From 6fe579396dd17eb016a9b4623519d9a7e6e24349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Thu, 21 Mar 2024 01:46:30 +0800 Subject: [PATCH] chore: upgrade deps --- package.json | 3 ++- pnpm-lock.yaml | 18 +++++++++--------- src/core/options.ts | 7 ++++--- src/core/vue2.ts | 4 ++-- src/core/vue3.ts | 4 ++-- tests/vue2.test.ts | 4 ++-- tests/vue3.test.ts | 6 +++--- tsconfig.json | 6 +++--- 8 files changed, 27 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 64c19d4..214e640 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.2.2", "packageManager": "pnpm@8.15.5", "description": "Vue JSX plugin for both Vue 2 and 3.", + "type": "commonjs", "keywords": [ "unplugin", "rollup", @@ -82,7 +83,7 @@ "unplugin": "^1.10.0" }, "devDependencies": { - "@sxzz/eslint-config": "^3.8.6", + "@sxzz/eslint-config": "^3.8.7", "@sxzz/prettier-config": "^2.0.1", "@types/babel__core": "^7.20.5", "@types/node": "^20.11.30", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ecb2674..8037b9f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,8 +32,8 @@ dependencies: devDependencies: '@sxzz/eslint-config': - specifier: ^3.8.6 - version: 3.8.6(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.4.2) + specifier: ^3.8.7 + version: 3.8.7(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.4.2) '@sxzz/prettier-config': specifier: ^2.0.1 version: 2.0.1 @@ -994,8 +994,8 @@ packages: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true - /@sxzz/eslint-config@3.8.6(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.4.2): - resolution: {integrity: sha512-khbtTgXkHDjgydpfo/7oWJ+FgRgiaZzSEPkRqHJAxuUk8mFtvBxsOYe1xq19gscetc8Wk1PrdF+5UQ+/i+EKTA==} + /@sxzz/eslint-config@3.8.7(@typescript-eslint/parser@7.3.1)(eslint@8.57.0)(typescript@5.4.2): + resolution: {integrity: sha512-0R/l02hZtxGSbcpfL7zruBnaGRqphE3COHFLZhVCJj+E1d3sGGCi1e9G0B/LVt0ejdcm3Q41fVODSFAa0KVUIA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 || ^9.0.0 @@ -1008,7 +1008,7 @@ packages: eslint-plugin-eslint-comments: 3.2.0(eslint@8.57.0) eslint-plugin-i: 2.29.1(@typescript-eslint/parser@7.3.1)(eslint@8.57.0) eslint-plugin-jsonc: 2.14.1(eslint@8.57.0) - eslint-plugin-markdown: 3.0.1(eslint@8.57.0) + eslint-plugin-markdown: 4.0.1(eslint@8.57.0) eslint-plugin-n: 16.6.2(eslint@8.57.0) eslint-plugin-perfectionist: 2.7.0(eslint@8.57.0)(typescript@5.4.2)(vue-eslint-parser@9.4.2) eslint-plugin-prettier: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5) @@ -2229,11 +2229,11 @@ packages: synckit: 0.6.2 dev: true - /eslint-plugin-markdown@3.0.1(eslint@8.57.0): - resolution: {integrity: sha512-8rqoc148DWdGdmYF6WSQFT3uQ6PO7zXYgeBpHAOAakX/zpq+NvFYbDA/H7PYzHajwtmaOzAwfxyl++x0g1/N9A==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /eslint-plugin-markdown@4.0.1(eslint@8.57.0): + resolution: {integrity: sha512-5/MnGvYU0i8MbHH5cg8S+Vl3DL+bqRNYshk1xUO86DilNBaxtTkhH+5FD0/yO03AmlI6+lfNFdk2yOw72EPzpA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: '>=8' dependencies: eslint: 8.57.0 mdast-util-from-markdown: 0.8.5 diff --git a/src/core/options.ts b/src/core/options.ts index 73cc0ca..e8ff4be 100644 --- a/src/core/options.ts +++ b/src/core/options.ts @@ -1,6 +1,7 @@ +import process from 'node:process' import { getPackageInfo } from 'local-pkg' -import { type VueJSXPluginOptions } from '@vue/babel-plugin-jsx' -import { type FilterPattern } from '@rollup/pluginutils' +import type { VueJSXPluginOptions } from '@vue/babel-plugin-jsx' +import type { FilterPattern } from '@rollup/pluginutils' export type Vue2JSXOptions = { functional?: boolean @@ -30,7 +31,7 @@ export type OptionsResolved = Omit, 'version'> & { } export async function resolveOption( - options: Options + options: Options, ): Promise { const root = options.root || process.cwd() let version: 2 | 3 diff --git a/src/core/vue2.ts b/src/core/vue2.ts index 1b5bf08..ee5580d 100644 --- a/src/core/vue2.ts +++ b/src/core/vue2.ts @@ -4,12 +4,12 @@ import TS from '@babel/plugin-syntax-typescript' // @ts-expect-error import vue2Jsx from '@vue/babel-preset-jsx' import { isTS } from './utils' -import { type OptionsResolved } from './options' +import type { OptionsResolved } from './options' export const transformVue2 = ( code: string, id: string, - options: OptionsResolved + options: OptionsResolved, ) => { const transformOptions: TransformOptions = { babelrc: false, diff --git a/src/core/vue3.ts b/src/core/vue3.ts index b7266f5..b930862 100644 --- a/src/core/vue3.ts +++ b/src/core/vue3.ts @@ -3,12 +3,12 @@ import vue3Jsx from '@vue/babel-plugin-jsx' // @ts-expect-error import TS from '@babel/plugin-syntax-typescript' import { isTS } from './utils' -import { type OptionsResolved } from './options' +import type { OptionsResolved } from './options' export const transformVue3 = ( code: string, id: string, - options: OptionsResolved + options: OptionsResolved, ) => { const transformOptions: TransformOptions = { babelrc: false, diff --git a/tests/vue2.test.ts b/tests/vue2.test.ts index d0c25a3..eabaef8 100644 --- a/tests/vue2.test.ts +++ b/tests/vue2.test.ts @@ -26,13 +26,13 @@ describe('Vue 2', () => { await transform(``, { version: 2, vModel: false, - }) + }), ).toMatchSnapshot() expect( await transform(``, { version: 2, vModel: true, - }) + }), ).toMatchSnapshot() }) }) diff --git a/tests/vue3.test.ts b/tests/vue3.test.ts index ab011c6..c9da4a6 100644 --- a/tests/vue3.test.ts +++ b/tests/vue3.test.ts @@ -5,7 +5,7 @@ import { transformVue3 } from '../src/core/vue3' const transform = async ( code: string, isTS = false, - userOptions: Options = {} + userOptions: Options = {}, ) => { const options = await resolveOption({ version: 3, @@ -31,13 +31,13 @@ describe('Vue 3', () => { await transform(``, false, { version: 3, transformOn: false, - }) + }), ).toMatchSnapshot() expect( await transform(``, false, { version: 3, transformOn: true, - }) + }), ).toMatchSnapshot() }) }) diff --git a/tsconfig.json b/tsconfig.json index 9718f70..be7564a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,16 +1,16 @@ { "compilerOptions": { "target": "es2022", - "lib": ["es2022"], "jsx": "preserve", + "lib": ["es2022"], "module": "esnext", "moduleResolution": "node", - "types": ["node"], "resolveJsonModule": true, - "esModuleInterop": true, + "types": ["node"], "strict": true, "exactOptionalPropertyTypes": true, "noUnusedLocals": true, + "esModuleInterop": true, "skipLibCheck": true }, "include": ["src", "tests"]