Files
SearcjGal-frontend/tsconfig.json
AdingApkgg 3d414157a0 依赖升级 + 代码质量、打包体积与组件结构优化
依赖:
- pnpm update --latest(vite、vue、eslint、typescript 等 14 个包到最新版)
- 显式加入 vue-eslint-parser ^10.4.0 / workbox-build ^7.4.1,消除 peer 警告

代码质量:
- 修复 ESLint vue parser 配置(用 vue-eslint-parser 作主 parser),lint 错误 17 → 0
- tsconfig 启用 noUncheckedIndexedAccess,修复 16 个潜在 undefined 访问 bug
- 删除未使用的 src/utils/icons.ts(723 行死代码)

打包体积:
- PWA precache 10.5 MB / 424 项 → 740 KB / 24 项(字体改为运行时缓存)
- vendor CSS gzip 201 KB → 141 KB(禁用字体 base64 内联,保留 unicode-range 子集策略)
- Artalk CSS 跟随 CommentsModal 异步加载
- 字体精简:移除未使用的 300 字重,补上用到的 600
- 删除僵尸的 fancybox manualChunks 配置

健壮性:
- SSE 搜索新增 AbortController + 60s 超时,新搜索取消旧请求,组件卸载取消进行中
- settings 持久化加 300ms 防抖 + QuotaExceededError 处理 + beforeunload 强制落盘

组件拆分:
- SearchHeader.vue 1330 → 1061 行,抽出 SearchErrorCard 子组件
- SettingsModal.vue 1289 → 1171 行,抽出 AdvancedApiSettings 子组件

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 07:23:19 +08:00

33 lines
779 B
JSON

{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
/* Vue */
"types": ["node"],
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "src/**/*.d.ts", "env.d.ts", "scripts/**/*.ts"],
"references": [{ "path": "./tsconfig.node.json" }]
}