Hacker News new | ask | show | jobs
by alvis 3158 days ago
TypeScript is never mean to be a replacement of Babel.

The spirit of TypeScript is code integrity. Imagine that you are working on a project which change often. In this case, refactoring and maintaining breaking changes are headache. How would you identify potential issues before pushing to CI and being punished by errors with no clue?

Babel and TypeScript are different. Babel is a transpiler which enable us to write modern syntax which are not widely supported, while TypeScript is a transpiler which help us to write in confidence and integrity.

1 comments

They are not different. They can both help developers write in confidence and integrity. Babel can do more.
Babel can't do type checking, right?
It absolutely can! That said, the way it currently works is that babel-preset-flow and babel-preset-typescript both remove type annotations for the final build, essentially enabling flow or typescript to work without having to also be build engines.