-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsconfig.base.json
More file actions
46 lines (46 loc) · 1.84 KB
/
tsconfig.base.json
File metadata and controls
46 lines (46 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"compilerOptions": {
// 允许从没有默认导出的模块中默认导入(如 CommonJS 模块)
"allowSyntheticDefaultImports": true,
// 始终以严格模式解析代码,并在每个文件顶部添加 "use strict"
"alwaysStrict": true,
// 设置模块解析的基础目录为当前目录(相对路径的基准)
"baseUrl": ".",
// 生成对应的 .d.ts 类型声明文件
"declaration": true,
// 生成声明文件的 sourcemap,方便调试
"declarationMap": true,
// 启用 ES 模块与 CommonJS 模块的互操作性
"esModuleInterop": true,
// 强制文件名大小写一致性(避免大小写敏感系统的问题)
"forceConsistentCasingInFileNames": true,
// 设置模块系统为 ES2022
"module": "ES2022",
// 模块解析策略为 Bundler(适用于现代打包工具如 webpack/rollup)
"moduleResolution": "Bundler",
// 不输出编译结果(仅进行类型检查)
"noEmit": true,
// 禁止 switch 语句中出现贯穿的 case(需明确 break 或 return)
"noFallthroughCasesInSwitch": true,
// 禁止隐式的 any 类型(需明确类型标注)
"noImplicitAny": true,
// 禁止隐式的 this 类型(需明确 this 类型)
"noImplicitThis": true,
// 禁止未使用的局部变量
"noUnusedLocals": true,
// 禁止未使用的函数参数
"noUnusedParameters": true,
// 允许导入 JSON 文件作为模块
"resolveJsonModule": true,
// 不跳过对类型定义文件(.d.ts)的检查
"skipLibCheck": false,
// 生成 sourcemap 文件,方便调试原始 TypeScript 代码
"sourceMap": true,
// 启用所有严格类型检查选项
"strict": true,
// 编译目标为 ECMAScript 2022
"target": "ES2022",
// 包含默认的类型定义
"types": ["@types/node"]
}
}