-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathtsconfig.json
More file actions
33 lines (33 loc) · 1.58 KB
/
tsconfig.json
File metadata and controls
33 lines (33 loc) · 1.58 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
{
"compilerOptions": {
"target": "ESNext", // 将代码编译为最新版本的 JS
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
/* 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 导出
"baseUrl": "./",
// 模块名到基于 baseUrl的路径映射的列表。
"paths": {
"@": ["src"],
"@/*": ["src/*"]
},
/* Linting */
"strict": true, // 开启所有严格的类型检查
"forceConsistentCasingInFileNames": true, // 不允许对同一个文件使用不一致格式的引用
"noUnusedLocals": true, //报告未使用的局部变量的错误
"noUnusedParameters": true, //报告函数中未使用参数的错误
"noFallthroughCasesInSwitch": true //确保switch语句中的任何非空情况都包含
},
"types": ["vite,client", "vite-plugin-svg-icons/client"],
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "vite.config.ts"],
"exclude": ["node_modules", "dist", "**/*.js"]
}