Asking genuinely as someone who knows not much about this subject, is typescript not already an option? Isn’t it just type safe js that gets interpreted as js?
Typescript doesn't run in browser. It gets translated to js by some build steps. I would also say it's only mostly type safe. You can kind of trick the system if you don't know what you're doing or don't like your coworkers.