From 1745a54eb6e7478f566e1a51b6df70b5f7a9f201 Mon Sep 17 00:00:00 2001 From: estel <690930@qq.com> Date: Tue, 29 Jul 2025 00:32:57 +0800 Subject: [PATCH] lint:fix all --- .github/nuxt.config.ts | 106 +++++----- app/app.vue | 9 +- app/components/AppHeader.vue | 132 ++++++++----- app/components/AppSidebar.vue | 45 +++-- app/components/ContentDirectory.vue | 16 +- app/components/IndexCard.vue | 143 ++++++++------ app/components/IndexHero.vue | 30 +-- app/components/LogoPro.vue | 5 +- app/components/ThemeSettings.vue | 44 +++-- app/components/auth/login.vue | 2 +- app/components/content/ButtonLink.vue | 43 +++-- app/components/content/ColorModeSwitch.vue | 4 +- app/components/content/ECard.vue | 53 ++--- app/components/content/ETabs.vue | 14 +- app/components/content/FileTree.vue | 124 ++++++------ app/components/content/FileTreeItem.vue | 69 ++++--- app/components/content/Playground.vue | 37 ++-- app/components/content/ProseH1.vue | 11 +- app/components/content/ProseH2.vue | 11 +- app/components/content/ProseH3.vue | 11 +- app/components/content/ProseH4.vue | 11 +- app/components/content/ProseH5.vue | 11 +- app/components/content/ProseH6.vue | 11 +- app/components/content/ReadMore.vue | 38 ++-- app/components/content/SmartIcon.vue | 18 +- app/components/content/Stack.vue | 15 +- app/components/docs/DocsAsideLeftTop.vue | 12 +- app/components/docs/DocsPageHeaderLinks.vue | 18 +- app/composables/useTheme.ts | 204 ++++++++++---------- app/error.vue | 47 ++--- app/layouts/default.vue | 27 ++- app/pages/[...slug].vue | 91 ++++++--- app/pages/index.vue | 4 +- nuxt.config.ts | 10 +- 34 files changed, 820 insertions(+), 606 deletions(-) diff --git a/.github/nuxt.config.ts b/.github/nuxt.config.ts index 2752888..b780a3b 100644 --- a/.github/nuxt.config.ts +++ b/.github/nuxt.config.ts @@ -1,11 +1,10 @@ -import { dirname, join } from 'node:path'; -import { fileURLToPath } from 'node:url'; -import tailwindcss from '@tailwindcss/vite'; +import { dirname, join } from 'node:path' +import { fileURLToPath } from 'node:url' +import tailwindcss from '@tailwindcss/vite' -const currentDir = dirname(fileURLToPath(import.meta.url)); +const currentDir = dirname(fileURLToPath(import.meta.url)) export default defineNuxtConfig({ - devtools: { enabled: true }, modules: [ 'shadcn-nuxt', '@vueuse/nuxt', @@ -16,42 +15,33 @@ export default defineNuxtConfig({ 'nuxt-og-image', '@nuxt/scripts', '@nuxtjs/i18n', - '@nuxt/fonts', + '@nuxt/fonts' ], - shadcn: { - prefix: 'Ui', - componentDir: join(currentDir, './components/ui'), - }, components: { dirs: [ { path: './components', - ignore: ['**/*.ts'], - }, - ], - }, - i18n: { - bundle: { - optimizeTranslationDirective: false, - }, - strategy: 'prefix_except_default', - }, - colorMode: { - classSuffix: '', - disableTransition: true, + ignore: ['**/*.ts'] + } + ] }, + devtools: { enabled: true }, css: [ join(currentDir, './assets/css/themes.css'), - '~/assets/css/tailwind.css', + '~/assets/css/tailwind.css' ], + colorMode: { + classSuffix: '', + disableTransition: true + }, content: { documentDriven: true, highlight: { theme: { default: 'github-light', - dark: 'github-dark', + dark: 'github-dark' }, - preload: ['json', 'js', 'ts', 'html', 'css', 'vue', 'diff', 'shell', 'markdown', 'mdc', 'yaml', 'bash', 'ini', 'dotenv'], + preload: ['json', 'js', 'ts', 'html', 'css', 'vue', 'diff', 'shell', 'markdown', 'mdc', 'yaml', 'bash', 'ini', 'dotenv'] }, navigation: { fields: [ @@ -65,40 +55,50 @@ export default defineNuxtConfig({ 'editLink', 'prevNext', 'breadcrumb', - 'fullpage', - ], + 'fullpage' + ] }, experimental: { search: { - indexed: true, - }, - }, + indexed: true + } + } }, - icon: { - clientBundle: { - scan: true, - sizeLimitKb: 512, - }, - }, - fonts: { - defaults: { - weights: ['300 800'], - }, + compatibilityDate: '2025-05-13', + vite: { + plugins: [ + tailwindcss() + ], + optimizeDeps: { + include: ['debug'] + } }, typescript: { tsConfig: { compilerOptions: { - baseUrl: '.', - }, - }, + baseUrl: '.' + } + } }, - vite: { - plugins: [ - tailwindcss(), - ], - optimizeDeps: { - include: ['debug'], - }, + fonts: { + defaults: { + weights: ['300 800'] + } }, - compatibilityDate: '2025-05-13', -}); + i18n: { + bundle: { + optimizeTranslationDirective: false + }, + strategy: 'prefix_except_default' + }, + icon: { + clientBundle: { + scan: true, + sizeLimitKb: 512 + } + }, + shadcn: { + prefix: 'Ui', + componentDir: join(currentDir, './components/ui') + } +}) diff --git a/app/app.vue b/app/app.vue index 097d108..147a155 100644 --- a/app/app.vue +++ b/app/app.vue @@ -12,16 +12,16 @@ const { selectedTheme, selectedFont, selectedFontSize } = useTheme() // 计算根元素的 CSS 类 const rootClasses = computed(() => { const classes = [] - + // 添加主题类 classes.push(`theme-${selectedTheme.value}`) - + // 添加字体类 classes.push(`font-${selectedFont.value}`) - + // 移除字号类,让它在具体组件中处理 // classes.push(`text-${selectedFontSize.value}`) - + return classes.join(' ') }) @@ -65,4 +65,3 @@ provide('navigation', navigation) - diff --git a/app/components/AppHeader.vue b/app/components/AppHeader.vue index d62a4d6..d8f647d 100644 --- a/app/components/AppHeader.vue +++ b/app/components/AppHeader.vue @@ -1,66 +1,93 @@