提交学习笔记专用
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.

66 lines
2.9 KiB

  1. {
  2. "compilerOptions": {
  3. // Most non-library projects don't need to emit declarations.
  4. // So we add this option by default to make the config more friendly to most users.
  5. "noEmit": true,
  6. // As long as you are using a build tool, we recommend you to author and ship in ES modules.
  7. // Even if you are targeting Node.js, because
  8. // - `CommonJS` is too outdated
  9. // - the ecosystem hasn't fully caught up with `Node16`/`NodeNext`
  10. // This recommendation includes environments like Vitest, Vite Config File, Vite SSR, etc.
  11. "module": "ESNext",
  12. // We expect users to use bundlers.
  13. // So here we enable some resolution features that are only available in bundlers.
  14. "moduleResolution": "bundler",
  15. "resolveJsonModule": true,
  16. "allowImportingTsExtensions": true,
  17. // Even files without `import` or `export` are treated as modules.
  18. // It helps to avoid mysterious errors such as `Cannot redeclare block-scoped variable 'name`.
  19. // https://www.totaltypescript.com/cannot-redeclare-block-scoped-variable#solution-3-your-module-isnt-a-module
  20. "moduleDetection": "force",
  21. // Required in Vue projects
  22. "jsx": "preserve",
  23. "jsxImportSource": "vue",
  24. // `"noImplicitThis": true` is part of `strict`
  25. // Added again here in case some users decide to disable `strict`.
  26. // This enables stricter inference for data properties on `this`.
  27. "noImplicitThis": true,
  28. "strict": true,
  29. // See <https://www.semver-ts.org/formal-spec/5-compiler-considerations.html#strictness>
  30. // These 2 options are also part of the recommended tsconfig as of TS 5.9
  31. "noUncheckedIndexedAccess": true,
  32. // Commented out for now. It's hard to land in the current ecosystem.
  33. // Needs more consensus before moving forward.
  34. // "exactOptionalPropertyTypes": true,
  35. // <https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#verbatimmodulesyntax>
  36. // Any imports or exports without a type modifier are left around. This is important for `<script setup>`.
  37. // Anything that uses the type modifier is dropped entirely.
  38. "verbatimModuleSyntax": true,
  39. // A few notes:
  40. // - Vue 3 supports ES2016+
  41. // - For Vite, the actual compilation target is determined by the
  42. // `build.target` option in the Vite config.
  43. // So don't change the `target` field here. It has to be
  44. // at least `ES2020` for dynamic `import()`s and `import.meta` to work correctly.
  45. // - If you are not using Vite, feel free to overwrite the `target` field.
  46. "target": "ESNext",
  47. // For spec compliance.
  48. // `true` by default if the `target` is `ES2020` or higher.
  49. // Explicitly set it to `true` here in case some users want to overwrite the `target`.
  50. "useDefineForClassFields": true,
  51. // Recommended
  52. "esModuleInterop": true,
  53. "forceConsistentCasingInFileNames": true,
  54. "libReplacement": false,
  55. // See <https://github.com/vuejs/vue-cli/pull/5688>
  56. "skipLibCheck": true,
  57. }
  58. }