I have seen companies that had ten times as many microservices than devs, our industry is full of cargo culting, ignorance and resume driven development.
While there is sometimes good reason to use TS, often you might be better served using JSDoc so you have type safety without the compilation step.
I currently see the direct comparison as my company has one project that uses old-school php backed rendering with a bit of vanilla js sprinkled it and one with modern React and TS. The React team is significantly less productive and the code is much harder to maintain, has more bugs, is less performant and harder ton onboard people to. But when I suggest that a new project does not not need to be a SPA, I always get booed.
To be fair, once bundling is part of the equation, using typescript becomes effectively free. The frameworks are another story but typescript itself is one of the more reasonable choices.
JSDoc would be unequivocally the superior choice if the browsers themselves hadn’t begun to make just opening the html file problematic by requiring HTTP origins for various parts of the API.
OK, but that's essentially "argument by authority" + "everyone is doing it".
They certainly have their reasons and they definitely aren't stupid, but it would be more useful to know what those reasons are and in what scope they are applicable.
Why types are good (even essential) for large projects has been documented quite extensively. Internet pushed JS to the forefront and as projects increased in scope and ambition, types became unavoidable.
More recently, see how there's a strong push towards types in Python. AI/ML is to Python what the internet was for JS. And types are here.
And from the linked post on the same website.
> if you write vanilla HTML, CSS, and JS, all you have to do is put that code in a web browser and it runs.
Very (very, very) few large projects use plain JS (instead of TS) these days. Let's stop acting like all these people don't know what they're doing.
This post is probably applicable to selected tiny and small projects. And for some of those, it may be better if there was no JS at all.