Hacker News new | ask | show | jobs
by marcus_cemes 1612 days ago
Well, good news for you, it does! Very well, in fact. Svelte itself is written in TypeScript.
1 comments

So is he wrong about not being able to type check that then?
Well, yes, to my understanding. If you add lang="ts" to the script block, you can write normal TypeScript code for the component logic, and it will also check props that you are passing to child components in the template. It's like renaming the file from ".jsx" to ".tsx". It might not be perfect, but I haven't encountered any problems with it so far.