From 46aa2da5a318dc2ee378cc5af03dbee8cc54b74f 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: Sat, 30 Nov 2024 02:58:57 +0800 Subject: [PATCH] docs: fix type error --- docs/.vitepress/theme/CustomLayout.vue | 3 +-- docs/.vitepress/vite.config.ts | 1 + docs/tsconfig.json | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/.vitepress/theme/CustomLayout.vue b/docs/.vitepress/theme/CustomLayout.vue index 5b6f816..cab480b 100644 --- a/docs/.vitepress/theme/CustomLayout.vue +++ b/docs/.vitepress/theme/CustomLayout.vue @@ -22,9 +22,8 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => { Math.max(x, innerWidth - x), Math.max(y, innerHeight - y), )}px at ${x}px ${y}px)`, - ] + ] - // @ts-expect-error any await document.startViewTransition(async () => { isDark.value = !isDark.value await nextTick() diff --git a/docs/.vitepress/vite.config.ts b/docs/.vitepress/vite.config.ts index 36b5242..e15f73b 100644 --- a/docs/.vitepress/vite.config.ts +++ b/docs/.vitepress/vite.config.ts @@ -14,6 +14,7 @@ export default defineConfig({ dirs: '.vitepress/components', dts: '.vitepress/components.d.ts', }), + // @ts-expect-error mismatch vite version Unocss(fileURLToPath(new URL('./uno.config.ts', import.meta.url))), Icons(), groupIconVitePlugin({ diff --git a/docs/tsconfig.json b/docs/tsconfig.json index 0c84528..aa677bd 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -1,4 +1,7 @@ { "extends": "../tsconfig.json", - "include": [".vitepress/**/*"] + "compilerOptions": { + "lib": ["DOM", "ESNext"] + }, + "include": [".vitepress/**/*", "../src/globals.d.ts"] }