This is a problem Microsoft recognized early on and they came up with the solution of TypeScript and released the first version on October 1st, 2012.
Latest stable version available is TypeScript 3.1.
If you want to try out TypeScript without installing it, visit the TypeScript Playground.
To learn more about installation, see the Installation Appendix.
In case you need just a type checker and don't want to compile your program, read about Flux.