tsconfig.json 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. // <https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#verbatimmodulesyntax>
  30. // Any imports or exports without a type modifier are left around. This is important for `<script setup>`.
  31. // Anything that uses the type modifier is dropped entirely.
  32. "verbatimModuleSyntax": true,
  33. // A few notes:
  34. // - Vue 3 supports ES2016+
  35. // - For Vite, the actual compilation target is determined by the
  36. // `build.target` option in the Vite config.
  37. // So don't change the `target` field here. It has to be
  38. // at least `ES2020` for dynamic `import()`s and `import.meta` to work correctly.
  39. // - If you are not using Vite, feel free to overwrite the `target` field.
  40. "target": "ESNext",
  41. // For spec compliance.
  42. // `true` by default if the `target` is `ES2020` or higher.
  43. // Explicitly set it to `true` here in case some users want to overwrite the `target`.
  44. "useDefineForClassFields": true,
  45. // Recommended
  46. "esModuleInterop": true,
  47. "forceConsistentCasingInFileNames": true,
  48. // See <https://github.com/vuejs/vue-cli/pull/5688>
  49. "skipLibCheck": true,
  50. }
  51. }