tsconfig.json 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {
  2. "compileOnSave": true,
  3. "compilerOptions": {
  4. "outDir": "./dist",
  5. "target": "ES2020",
  6. "lib": ["ES2020"],
  7. "module": "CommonJS", // 采用commonjs的模块风格
  8. "strict": true, // 启用所有严格类型检查选项
  9. "noImplicitAny": false, // 隐式any检查
  10. "allowJs": true,
  11. "alwaysStrict": true, // 以严格模式检查每个模块,并在每个文件里加入 'use strict'
  12. "noImplicitReturns": true, // 函数末尾返回值
  13. "noFallthroughCasesInSwitch": true, // switch case直接break
  14. "allowUnreachableCode": true, // 未执行代码
  15. "allowUnusedLabels": true, // 未执行标签
  16. "strictNullChecks": true, // 空检查
  17. "checkJs": true, // 检查js错误
  18. "declaration": false, // 生成相应的 '.d.ts' 文件
  19. "removeComments": true, // 删除编译后的所有的注释
  20. "importHelpers": true, // 从 tslib 导入辅助工具函数
  21. "moduleResolution": "node", // 选择模块解析策略
  22. "experimentalDecorators": true,
  23. "emitDecoratorMetadata": true,
  24. "charset": "utf8",
  25. "pretty": true,
  26. "noUnusedLocals": true,
  27. "noUnusedParameters": true,
  28. "inlineSourceMap": true,
  29. "skipLibCheck": true,
  30. "skipDefaultLibCheck": true,
  31. "esModuleInterop": true,
  32. "baseUrl": "./src",
  33. "paths": {
  34. "@/*": ["./*"],
  35. // "@controllers/*": ["./controllers/*"],
  36. "@controllers": ["./controllers/index.ts"],
  37. "@services": ["./services/*"],
  38. "@utils/*": ["./utils/*"],
  39. "@config": ["./config.ts"]
  40. },
  41. "plugins": [
  42. { "transform": "typescript-transform-paths" }
  43. ]
  44. },
  45. "include": [
  46. "./src"
  47. ]
  48. }