Typescript has an interesting approach to type checking: it will emit JS even if the code isn't well-typed! https://basarat.gitbooks.io/typescript/docs/why-typescript.html
(This is a nice property of gradual typing: you can run unit tests on refactored code even when some code still uses the old API.)