You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {
  2. "compilerOptions": {
  3. "strictNullChecks": true,
  4. // "allowImportingTsExtensions": true, // 支持 .ts 扩展名导入
  5. "strictFunctionTypes": false,
  6. "noUnusedLocals": false,
  7. "noUnusedParameters": false,
  8. "noImplicitReturns": false,
  9. "noFallthroughCasesInSwitch": false,
  10. "target": "esnext",
  11. "module": "esnext", //module:指定哪种版本的模块化
  12. "moduleResolution": "node",
  13. "strict": false, //所有严格模式的总开关
  14. "jsx": "preserve",
  15. "sourceMap": true, //sourceMap 简单说,Source map 就是一个信息文件,里面储存着位置信息。也就是说,转换后的代码的每一个位置,所对应的转换前的位置。有了它,出错的时候,除错工具将直接显示原始代码,而不是转换后的代码。这无疑给开发者带来了很大方便。
  16. "resolveJsonModule": true, //方便导入 JSON 文件(如配置文件)。
  17. "esModuleInterop": true, //让项目能更兼容 CommonJS 模块(如某些 Node.js 库)。
  18. "skipLibCheck": true, //跳过库文件的类型检查
  19. "alwaysStrict": false, //用来设置编译后的文件是否使用严格模式,默认为false
  20. "removeComments": true, //是否移除注释
  21. "lib": ["esnext", "dom"], //用来指定项目中使用的库
  22. "baseUrl": ".",
  23. "paths": {
  24. "@/*": ["src/*"],
  25. "components/*": ["src/components/*"],
  26. "utils/*": ["src/utils/*"]
  27. },
  28. "noImplicitAny": false, // 是否在表达式和声明上有隐含的any类型时报错
  29. "noImplicitThis": true, // 不允许不明确类型的this,【默认为true】
  30. "types": ["element-plus/global", "node"], //指定全局组件类型
  31. "allowSyntheticDefaultImports": true
  32. },
  33. "include": [
  34. //指定 TypeScript 编译器编译的文件列表。
  35. "src/**/*.ts",
  36. "src/**/*.d.ts",
  37. "src/**/*.tsx",
  38. "src/**/*.vue",
  39. "vite.config.ts", // 确保 Vite 配置文件的类型检查
  40. "src/api/system/commonApi.js"
  41. ],
  42. // "angularCompilerOptions": {
  43. // "strictInjectionParameters": true,
  44. // "strictTemplates": true,
  45. // "fullTemplateTypeCheck": true
  46. // },
  47. "editor": {
  48. "suggestions": {
  49. "strings": false
  50. }
  51. },
  52. "exclude": [
  53. //取消在 HTML 文件中的 TypeScript 校验
  54. // "src/**/*.vue",
  55. "node_modules/**/*",
  56. "dist",
  57. "**/*.test.ts",
  58. "elment-plus/**/*"
  59. ]
  60. }