Skip to content

Conversation

@ArnaudBarre
Copy link
Contributor

I just tested the template and wanted to improve the TS config setup to match a bit more what I've did for Vite and Bun templates. A few points:

  • Drop composite file that is not needed and merge everything into one tsconfig
  • Remove node from types which avoid polluting code completions with node globals for an SPA starter. This also match the fact that the dependency is not explicit and the fact that the only real node file, the vite config, is in JS. If this changed to a TS file (I would be in favor), adding @types/node and adding back "types": ["vite/client", "node"], would provide a good setup without adding 3 tsconfigs like in Vite
  • Use bundler resolution mode that match the fact that the app is bundled by Vite and that allows to use file extensions. This makes tooling faster because each tool don't need to test various extensions to find files on disk.
  • Add noEmit because for apps there is no point to emit types
  • Add verbatimModuleSyntax which makes tools like esbuild predictable on how to preserve or drop imports
  • Add basics linting flags. I personally always uses useUnknownInCatchVariables and noPropertyAccessFromIndexSignature but they can add friction for people not use to them so like in Vite they are not included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants