Using tsc to type check javascript - with JSDoc type annotations - works fine. You're really not missing much from "real" typescript, and you can save yourself a transpile.
Using tsc to type check javascript - with JSDoc type annotations - works fine. You're really not missing much from "real" typescript, and you can save yourself a transpile.
I tried the experiment of .js files driven by typescript in JSDocs for around 10k lines and there is a night and day difference in what you can express, how and reuse it at the type level.
Name one thing you can't do.
To clairfy, if I am sharing types between modules I tend to use .d.ts files. Still no transpiling needed.
The limitations are too much for complex projects at scale. I strongly believe this is why Closure types didn't take off.
That and Google's lack of developer relations around the project
Yes, you can. Using `import('./someFile').SomeType`
Though I do agree, JSDoc works, but isn't as nice as directly writing types in a .ts file
And no it's not the case you may as well write typescript at that point - because you're still using the actual language the browser runs, and not transpiling.