Repository navigation
Expand file tree
/
Copy pathtsconfig.json
More file actions
71 lines (71 loc) · 2.11 KB
/
Copy pathtsconfig.json
File metadata and controls
71 lines (71 loc) · 2.11 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
"compilerOptions": {
"ignoreDeprecations": "6.0",
// 🔧 调整目标版本以提高兼容性
"target": "ES2020", // 从 ES2022 降级,更好的第三方库兼容性
"useDefineForClassFields": false, // 🔑 关键修复:使用传统类字段行为
"module": "ESNext",
"lib": [
"DOM",
"ES2020", // 与 target 保持一致
"ESNext.Promise"
],
// 模块解析
"moduleResolution": "Bundler",
"moduleDetection": "force",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
// 🔧 调整严格模式设置以提高兼容性
"strict": true, // 保持 false,避免过于严格
"noImplicitAny": true,
"strictFunctionTypes": false, // 🔧 放宽函数类型检查
"strictNullChecks": true,
"exactOptionalPropertyTypes": false, // 🔧 放宽可选属性检查
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": false, // 🔧 放宽索引访问检查
"noImplicitOverride": false, // 🔧 放宽重写检查
// 输出配置
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "dist",
"rootDir": "lib",
// 🔧 性能和兼容性优化
"skipLibCheck": true, // 保持,跳过库类型检查
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"verbatimModuleSyntax": false,
"resolveJsonModule": true,
"preserveSymlinks": true,
"maxNodeModuleJsDepth": 3, // 🔧 增加深度以更好处理嵌套依赖
// 🔧 添加兼容性设置
"allowJs": true, // 允许 JS 文件
"checkJs": false, // 不检查 JS 文件类型
"downlevelIteration": true,
"importHelpers": true, // 使用 tslib 辅助函数
// 🚀 路径映射(保持不变)
"baseUrl": ".",
"paths": {
"@/*": [
"lib/*"
],
"@/types/*": [
"lib/types/*"
],
"@/utils/*": [
"lib/utils/*"
]
}
},
"include": [
"lib/**/*.ts",
"lib/**/*.tsx"
],
"exclude": [
"node_modules",
"dist",
"**/*.test.ts",
"**/*.spec.ts"
]
}