tsconfig.json 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. {
  2. "$schema": "https://json.schemastore.org/tsconfig",
  3. "compilerOptions": {
  4. "baseUrl": ".",
  5. // https://vite.dev/config/build-options.html#build-target
  6. "target": "ES2020",
  7. "module": "ESNext",
  8. "moduleResolution": "Bundler",
  9. "lib": ["ESNext", "DOM", "DOM.Iterable"],
  10. "skipLibCheck": true,
  11. // This setting lets you specify a file for storing incremental compilation information as a part of composite projects which enables faster building of larger TypeScript codebases.
  12. "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo",
  13. "strict": true,
  14. "allowJs": true,
  15. "jsx": "preserve",
  16. "sourceMap": true,
  17. "resolveJsonModule": true,
  18. "esModuleInterop": true,
  19. "noEmit": true,
  20. "paths": {
  21. "@/*": ["./src/*"]
  22. },
  23. "types": ["node", "vite/client"],
  24. // 自定义配置
  25. "noImplicitAny": false, // 禁用 隐式的any错误
  26. "removeComments": true, // 移除 ts注释
  27. "experimentalDecorators": true, // 启用实验性的装饰器支持
  28. "strictFunctionTypes": false, // 禁用严格函数类型检查
  29. "strictNullChecks": false, // 禁用严格的空值检查
  30. "allowSyntheticDefaultImports": true, // 允许默认导入
  31. "forceConsistentCasingInFileNames": true // 强制在文件名中使用一致的大小写
  32. },
  33. "include": [
  34. "src/**/*.ts",
  35. "src/**/*.vue",
  36. "vite.config.ts",
  37. "vitest.config.ts",
  38. "eslint.config.ts",
  39. "src/**/*.d.ts"
  40. ],
  41. "exclude": ["node_modules", "dist", "src/**/__tests__/*"]
  42. }