From fed6db3a4c2a303e1c3fbb45e9c41e7421cbbe12 Mon Sep 17 00:00:00 2001 From: chouchouji <1305974212@qq.com> Date: Fri, 13 Dec 2024 21:52:28 +0800 Subject: [PATCH 1/2] chore: add .prettierignore --- .prettierignore | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..1b8643d --- /dev/null +++ b/.prettierignore @@ -0,0 +1,7 @@ +**/package.json +**/*.md +.github/** + +pnpm-lock.yaml +pnpm-workspace.yaml + From b07ed1574221c071916e01fed758a088bb2ae146 Mon Sep 17 00:00:00 2001 From: chouchouji <1305974212@qq.com> Date: Fri, 13 Dec 2024 21:52:37 +0800 Subject: [PATCH 2/2] style: format code --- playground/vite.config.ts | 2 +- src/core/context.ts | 2 +- src/core/devalue.ts | 4 ++-- tsup.config.ts | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/playground/vite.config.ts b/playground/vite.config.ts index bd84c8a..010f3af 100644 --- a/playground/vite.config.ts +++ b/playground/vite.config.ts @@ -15,7 +15,7 @@ export default defineConfig({ // assetsInlineLimit: 4096 * 2, }, server: { - port: 8451 + port: 8451, }, // publicDir: 'base/public', plugins: [ diff --git a/src/core/context.ts b/src/core/context.ts index 0275a1a..8361993 100644 --- a/src/core/context.ts +++ b/src/core/context.ts @@ -362,7 +362,7 @@ export function resolveOptions( ({ ...options[item], ...transformType[item], - } as ResolvedOptions), + }) as ResolvedOptions, ); const obj = {}; keys.forEach((item, index) => { diff --git a/src/core/devalue.ts b/src/core/devalue.ts index 0f75def..ad6b930 100644 --- a/src/core/devalue.ts +++ b/src/core/devalue.ts @@ -61,7 +61,7 @@ function devalue(value) { proto !== Object.prototype && proto !== null && Object.getOwnPropertyNames(proto).sort().join('\0') !== - objectProtoOwnPropertyNames + objectProtoOwnPropertyNames ) { if (typeof thing.toJSON !== 'function') { log( @@ -118,7 +118,7 @@ function devalue(value) { if (getType(json) === 'String') { try { json = JSON.parse(json); - } catch (e) { } + } catch (e) {} } return stringify(json); } diff --git a/tsup.config.ts b/tsup.config.ts index 487df79..5a2a847 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -1,5 +1,5 @@ -import { defineConfig } from 'tsup' -import Unused from 'unplugin-unused/esbuild' +import { defineConfig } from 'tsup'; +import Unused from 'unplugin-unused/esbuild'; export default defineConfig({ entry: ['./src/*.ts'], @@ -11,4 +11,4 @@ export default defineConfig({ cjsInterop: true, shims: true, esbuildPlugins: [Unused()], -}) +});