This commit is contained in:
2026-05-04 00:18:39 +08:00
parent bca6c31df7
commit 015c4fb91e
18 changed files with 453 additions and 410 deletions

View File

@@ -0,0 +1,40 @@
{
// tsconfig.base.json用于被 tesconfig.json 和 tesconfig.build.json 继承
"compilerOptions": {
// 输出模块语法,使用版本号最新的那个,而不是实验性语法 ESNext
"module": "es2022",
// 模块解析策略,模拟 Vite / Rollup / webpack支持 exports / imports不强制 Node ESM 的严格规则
"moduleResolution": "bundler",
// 显式声明使用的类型包
"types": ["node", "react", "vite/client"],
// 开启所有严格类型检查,防止 any / 隐式 any 扩散
"strict": true,
// 允许 ESM 导入 CJS
"esModuleInterop": true,
// 跳过 node_modules 类型检查,加快构建,避免第三方类型污染
"skipLibCheck": true,
// 模块检测策略,不会影响 node_modules 中的第三方 CommonJS 依赖Vite 会在预构建阶段自动将其转换为 ESM。
"moduleDetection": "force",
// 保留源码中的 import / export 语句原样输出,不进行自动转换(如 import → require通常与 moduleDetection: "force" 搭配使用
"verbatimModuleSyntax": true,
// 是否检查“未使用的局部变量”
"noUnusedLocals": true,
// 是否检查“未使用的函数参数”
"noUnusedParameters": true,
// 是否只允许“可擦除的语法Erasable Syntax确保 TypeScript 语法在编译后可完全移除
"erasableSyntaxOnly": true,
// 是否禁止 switch 语句中的 case 贯穿fallthrough如果 case 没有 break / return会报错
"noFallthroughCasesInSwitch": true
}
}