-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsconfig.json
70 lines (70 loc) · 2.32 KB
/
tsconfig.json
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": [
"ES2020",
"DOM",
"DOM.Iterable"
],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "vue",
/* Linting */
"strict": true,
"noUnusedLocals": true, // 有未使用的变量时,抛出错误
"noUnusedParameters": true, // 有未使用的参数时,抛出错误
"noFallthroughCasesInSwitch": true, // 报告 switch 语句的 fallthrough 错误。(即,不允许 switch 的 case 语句贯穿)
"noImplicitAny": true, // 在表达式和声明上有隐含的 any 类型时报错
"noImplicitThis": true, // 当 this 表达式值为 any 类型的时候,生成一个错误
"alwaysStrict": true, // 以严格模式检查每个模块,并在每个文件里加入 'use strict'
"strictFunctionTypes": true, // 函数类型的参数要求为相同类型
"strictPropertyInitialization": true, // 类的实例属性必须初始化
"strictBindCallApply": true, // 严格的 bind/call/apply 检查
"strictNullChecks": true, // 启用严格的 null 检查
/* Additional Checks */
"noImplicitReturns": true, // 并不是所有函数里的代码都有返回值时,抛出错误
"noUncheckedIndexedAccess": true, // 用于监视可能是 null 的索引表达式
"noImplicitOverride": true, // 当在重写方法时,如果没有正确匹配到父类的方法时,抛出错误
"noPropertyAccessFromIndexSignature": false, // 防止通过索引签名访问属性时出错
"types": [
"node",
"vite/client",
"unplugin-vue-macros/macros-global"
],
"baseUrl": "./",
"paths": {
"@/*": [
"./src/*"
]
},
"typeRoots": [
"./node_modules/@types/",
"./node_modules",
"./src/typings/"
] // 指定包含类型声明的文件或文件夹
},
"vueCompilerOptions": {
"plugins": [
"unplugin-vue-macros/volar"
]
},
"include": [
"src/**/*.ts",
"src/**/*.d.ts",
"src/**/*.tsx",
"src/**/*.vue"
],
"references": [
{
"path": "./tsconfig.node.json"
}
]
}