Re:TypeScript is now officially 10 years old
by kuramitropolis on Sunday October 09, 2022 @10:40AM
(#33141599)
>At the moment vscode only checks files that are currently open
While TSC checks everything by default - even files that are not even part of the dependency graph. That's how great the "great tooling" is in reality.
>I think type checking should only be done when building to some sort of production or realtime in your editor.
Agreed, that's the lest awful option. The problem is that they had 10 years to think of it, and didn't.
>Templates like "create react app"
...are a big part of the problem. "But I don't want to spend a whole day just setting up a project!" You wouldn't have to, if you didn't drink the React kool-aid in the first place.
A perfect scenario for me is having all errors in the project caught by vscode. At the moment vscode only checks files that are currently open. I think type checking should only be done when building to some sort of production or realtime in your editor. Templates like "create react app" can report runtime errors but it's somewhat strange that it also report typescript errors. (although understandable given that it wants to be tooling agnostic)
One potential major upside with adding optional type hints to javascript is the ability to run typescript files directly in the browser without needing to strip types in a build step. Advanced type checking could be done the same way we use linters like eslint.