tsconfig.json 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. {
  2. // 定义项目中包含的文件列表
  3. "files": [],
  4. // 定义项目中引用的其他配置文件
  5. "references": [
  6. { "path": "./tsconfig.app.json" },
  7. { "path": "./tsconfig.node.json" }
  8. ],
  9. // 设置编译器选项
  10. "compilerOptions": {
  11. // 定义类型根目录,用于指定在哪里查找类型定义文件
  12. "typeRoots": ["./node_modules/@types", "./src/types"],
  13. // 设置JavaScript代码生成的目标版本
  14. "target": "ES2020",
  15. // 使用定义字段时生成定义属性
  16. "useDefineForClassFields": true,
  17. // 设置模块系统的类型
  18. "module": "ESNext",
  19. // 指定要包含的库
  20. "lib": ["ES2020","DOM","DOM.Iterable"],
  21. // 跳过对库的类型检查
  22. "skipLibCheck": true,
  23. // 设置模块解析策略
  24. "moduleResolution": "bundler",
  25. // 允许从具有默认导出的模块中进行默认导入
  26. "allowSyntheticDefaultImports": true,
  27. // 允许导入JSON模块
  28. "resolveJsonModule": true,
  29. // 将每个文件作为独立的模块对待
  30. "isolatedModules": true,
  31. // 不生成任何输出文件
  32. "noEmit": true,
  33. // 保留JSX语法
  34. "jsx": "preserve",
  35. // 启用严格类型检查
  36. "strict": false,
  37. // 警告未使用的局部变量
  38. "noUnusedLocals": true,
  39. // 警告未使用的参数
  40. "noUnusedParameters": true,
  41. // 在switch语句中禁止fallthrough行为
  42. "noFallthroughCasesInSwitch": true,
  43. // 设置基础目录
  44. "baseUrl": ".",
  45. // 设置路径映射
  46. "paths": {
  47. "@/*": ["./src/*"]
  48. }
  49. },
  50. // 指定要包含在编译中的文件
  51. "include": ["./src/**/*.ts", "./src/**/*.d.ts", "./src/**/*.tsx", "./src/**/*.vue"]
  52. }