diff --git a/package.json b/package.json index f21822a..352a68c 100644 --- a/package.json +++ b/package.json @@ -27,9 +27,9 @@ "vue-router": "^4.5.1" }, "devDependencies": { - "@types/axios": "^0.9.36", - "@typescript-eslint/eslint-plugin": "5.62.0", - "@typescript-eslint/parser": "5.62.0", + "@types/node": "^20.19.0", + "@typescript-eslint/eslint-plugin": "6.13.2", + "@typescript-eslint/parser": "6.13.2", "@vitejs/plugin-vue": "^4.2.3", "@vue/eslint-config-typescript": "12.0.0", "@vue/tsconfig": "^0.7.0", @@ -48,6 +48,6 @@ "typescript": "5.1.6", "vite": "^4.4.9", "vite-plugin-image-optimizer": "^1.1.8", - "vue-tsc": "^2.2.10" + "vue-tsc": "1.8.14" } } diff --git a/tsconfig.app.json b/tsconfig.app.json index 9a1021e..f817746 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -2,9 +2,14 @@ "extends": "@vue/tsconfig/tsconfig.dom.json", "compilerOptions": { "baseUrl": ".", + "lib": [ + "ES2022", + "DOM" + ], + // 关键:添加 DOM 类型库 "paths": { "@/*": [ - "src/*" + "./src/*" ] // 添加路径别名 }, @@ -14,22 +19,26 @@ "vite/client", "vue" ], + "incremental": true, // 添加这一行 // 新增 Vue 类型声明 "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", /* Linting */ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, -// "erasableSyntaxOnly": true, // 移除这个不支持的选项 - "noFallthroughCasesInSwitch": true, -// "noUncheckedSideEffectImports": true + // "erasableSyntaxOnly": true, // 移除这个不支持的选项 + "noFallthroughCasesInSwitch": true + // "noUncheckedSideEffectImports": true }, "include": [ "src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", - "src/**/*.vue", // 必须包含 Vue 文件 - "vite.config.ts", // 包含 Vite 配置文件 - "src/main.ts" // 包含入口文件 + "src/**/*.vue", + // 必须包含 Vue 文件 + "vite.config.ts", + // 包含 Vite 配置文件 + "src/main.ts" + // 包含入口文件 ] } diff --git a/tsconfig.node.json b/tsconfig.node.json index abca77a..5eee59c 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -2,32 +2,45 @@ "compilerOptions": { "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", "target": "ES2022", - "lib": ["ES2023"], + "lib": [ + "ES2022", + "DOM", + ], + "paths": { + "@/*": [ + "./src/*" + ] + // 添加路径别名 + }, "module": "ESNext", "skipLibCheck": true, - /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, "verbatimModuleSyntax": true, "moduleDetection": "force", "noEmit": true, - + "esModuleInterop": true, + // 关键:允许 CommonJS 导入 /* Linting */ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, - "erasableSyntaxOnlsy": true, + // "erasableSyntaxOnlsy": true, "noFallthroughCasesInSwitch": true, - "noUncheckedSideEffectImports": true + "incremental": true + // "noUncheckedSideEffectImports": true }, -// "include": ["vite.config.ts"] + // "include": ["vite.config.ts"] "include": [ "src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", - "src/**/*.vue", // 必须包含 Vue 文件 - "vite.config.ts", // 包含 Vite 配置文件 - "src/main.ts" // 包含入口文件 + "src/**/*.vue", + // 必须包含 Vue 文件 + "vite.config.ts", + // 包含 Vite 配置文件 + "src/main.ts" + // 包含入口文件 ] }