3 ms·
I still use Babel with TypeScript. This gives me the benefit of TS (specifically, typing), on my preferred development machine (Windows, where FB Flow is reall
by StephenCleary 10y ago
I still use Babel with TypeScript.
This gives me the benefit of TS (specifically, typing), on my preferred development machine (Windows, where FB Flow is really crappy), while getting language-level polyfills (like generators) from Babel.
A nice side effect of having TS "compile" to ES6 modules is that Babel's nice-module-loading is used, which means I can just "import _ from 'lodash'" and never have to mess around with "* as" and the endless manipulation of .d.ts files.
That said, there are still things missing. In particular, object spread support, which is so nice when using Redux.
I've thought about maybe doing a Babel precompile, followed by TS for typing, then a Babel "real compile", but that's probably just crazy.