I think typescript should always be used. In build scripts, browser-side, serverside, or even code snippets.
Its also my opinion that most projects type definitions don't haveto be watertight. Only define the types one need when one need them, and dont overcomplicate things.
I really like TS, but I still prefer vanilla JS for small R&D projects. Setting up TS infrastructure and fighting with types is waste of time if you just need to check a hypothesis and throw away the project when it's done.
If TypeScript were the standard for many years, I would definitely agree.
But if you have a whole codebase to migrate or a team that is not proficient with TypeScript, I'm not sure if that would be a good choice since it would cost a lot. That's why I think the pros and cons should be measured beforehand.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.