20250610 build、lint、dev均配置成功
This commit is contained in:
parent
4c8f9b53aa
commit
886ecb6c2e
@ -27,9 +27,9 @@
|
|||||||
"vue-router": "^4.5.1"
|
"vue-router": "^4.5.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/axios": "^0.9.36",
|
"@types/node": "^20.19.0",
|
||||||
"@typescript-eslint/eslint-plugin": "5.62.0",
|
"@typescript-eslint/eslint-plugin": "6.13.2",
|
||||||
"@typescript-eslint/parser": "5.62.0",
|
"@typescript-eslint/parser": "6.13.2",
|
||||||
"@vitejs/plugin-vue": "^4.2.3",
|
"@vitejs/plugin-vue": "^4.2.3",
|
||||||
"@vue/eslint-config-typescript": "12.0.0",
|
"@vue/eslint-config-typescript": "12.0.0",
|
||||||
"@vue/tsconfig": "^0.7.0",
|
"@vue/tsconfig": "^0.7.0",
|
||||||
@ -48,6 +48,6 @@
|
|||||||
"typescript": "5.1.6",
|
"typescript": "5.1.6",
|
||||||
"vite": "^4.4.9",
|
"vite": "^4.4.9",
|
||||||
"vite-plugin-image-optimizer": "^1.1.8",
|
"vite-plugin-image-optimizer": "^1.1.8",
|
||||||
"vue-tsc": "^2.2.10"
|
"vue-tsc": "1.8.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,9 +2,14 @@
|
|||||||
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
|
"lib": [
|
||||||
|
"ES2022",
|
||||||
|
"DOM"
|
||||||
|
],
|
||||||
|
// 关键:添加 DOM 类型库
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": [
|
"@/*": [
|
||||||
"src/*"
|
"./src/*"
|
||||||
]
|
]
|
||||||
// 添加路径别名
|
// 添加路径别名
|
||||||
},
|
},
|
||||||
@ -14,6 +19,7 @@
|
|||||||
"vite/client",
|
"vite/client",
|
||||||
"vue"
|
"vue"
|
||||||
],
|
],
|
||||||
|
"incremental": true, // 添加这一行
|
||||||
// 新增 Vue 类型声明
|
// 新增 Vue 类型声明
|
||||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||||
/* Linting */
|
/* Linting */
|
||||||
@ -21,15 +27,18 @@
|
|||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
// "erasableSyntaxOnly": true, // 移除这个不支持的选项
|
// "erasableSyntaxOnly": true, // 移除这个不支持的选项
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true
|
||||||
// "noUncheckedSideEffectImports": true
|
// "noUncheckedSideEffectImports": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts",
|
"src/**/*.ts",
|
||||||
"src/**/*.d.ts",
|
"src/**/*.d.ts",
|
||||||
"src/**/*.tsx",
|
"src/**/*.tsx",
|
||||||
"src/**/*.vue", // 必须包含 Vue 文件
|
"src/**/*.vue",
|
||||||
"vite.config.ts", // 包含 Vite 配置文件
|
// 必须包含 Vue 文件
|
||||||
"src/main.ts" // 包含入口文件
|
"vite.config.ts",
|
||||||
|
// 包含 Vite 配置文件
|
||||||
|
"src/main.ts"
|
||||||
|
// 包含入口文件
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,32 +2,45 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"lib": ["ES2023"],
|
"lib": [
|
||||||
|
"ES2022",
|
||||||
|
"DOM",
|
||||||
|
],
|
||||||
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"./src/*"
|
||||||
|
]
|
||||||
|
// 添加路径别名
|
||||||
|
},
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
|
||||||
/* Bundler mode */
|
/* Bundler mode */
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": true,
|
||||||
"moduleDetection": "force",
|
"moduleDetection": "force",
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
// 关键:允许 CommonJS 导入
|
||||||
/* Linting */
|
/* Linting */
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"erasableSyntaxOnlsy": true,
|
// "erasableSyntaxOnlsy": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"noUncheckedSideEffectImports": true
|
"incremental": true
|
||||||
|
// "noUncheckedSideEffectImports": true
|
||||||
},
|
},
|
||||||
// "include": ["vite.config.ts"]
|
// "include": ["vite.config.ts"]
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts",
|
"src/**/*.ts",
|
||||||
"src/**/*.d.ts",
|
"src/**/*.d.ts",
|
||||||
"src/**/*.tsx",
|
"src/**/*.tsx",
|
||||||
"src/**/*.vue", // 必须包含 Vue 文件
|
"src/**/*.vue",
|
||||||
"vite.config.ts", // 包含 Vite 配置文件
|
// 必须包含 Vue 文件
|
||||||
"src/main.ts" // 包含入口文件
|
"vite.config.ts",
|
||||||
|
// 包含 Vite 配置文件
|
||||||
|
"src/main.ts"
|
||||||
|
// 包含入口文件
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user