-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsconfig.json
More file actions
30 lines (28 loc) · 1.5 KB
/
tsconfig.json
File metadata and controls
30 lines (28 loc) · 1.5 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
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true, // 跳过 .d .ts 文件的类型检查
"baseUrl": ".", // 查询的基本路径
"paths": { "@/*": ["src/*"] }, // 路径映射,配合别名使用
/* Bundler mode */
"moduleResolution": "Node", // 使用 Node 的模块解析策略
"allowImportingTsExtensions": true, // 允许在模块导入语句中使用 Typescript文件的扩展名 (.ts)
"allowJs": true, // 允许使用 JS
"resolveJsonModule": true, // 允许引入JSON文件
"isolatedModules": true, // 要求所有的文件都是ES Module 模块
"noEmit": true, // 不输出文件,即编译后不会生成任何JS文件
"jsx": "react-jsx", // 将JSX代码转换为普通的JavaScript代码
"esModuleInterop": true, // 允许使用 import 引入使用 export 导出
/* Linting */
"strict": true, // 开启所有的严格的类型检查
"forceConsistentCasingInFileNames": true, // 不允许对同一个文件使用不一致格式的引用
"noUnusedLocals": true, // 不允许对同一个文件使用不一致格式的引用
"noUnusedParameters": true, // 报告函数中未使用参数的错误
"noFallthroughCasesInSwitch": true // 确保 switch 语句中的任何非空情况都被包括
},
"include": ["src"], // 需要检测的文件
"references": [{ "path": "./tsconfig.node.json" }] // 为文件进行不同配置
}