Skip to content

JavaScript over TypeScript for SvelteKit codebase #4429

Answered by geoffrich
hanneswidrig asked this question in Q&A
Discussion options

You must be logged in to vote

Note that SvelteKit is still typed, but uses JSDoc instead of TypeScript. You can find some tweets from Rich Harris about this, but it comes down to a few reasons:

  • You can still generate types from JSDoc source code and the resulting code is generally smaller than TS-compiled code (source)
  • Using JS made it easier to make changes when the project was in an experimental phase (source)
  • Using JSDoc types means you can run tests without adding a build step (source)

Maintainers have said in the past that Kit could go back to TypeScript after 1.0, but so far JSDoc types are working well for the project.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hanneswidrig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants