3 ms·
Two downsides to TS: an extra step to transpile, and having to write shims when it bugs out and can't verify an external declaration. Upsides? When tuned to it
by SavantIdiot 6y ago
Two downsides to TS: an extra step to transpile, and having to write shims when it bugs out and can't verify an external declaration.
Upsides? When tuned to its most pedantic settings I've uncovered a handful of bugs that would have otherwise launched.
That's worth far more than a few tiny annoyances. tslint > jslint.
- SmellyPotato22 6y agoIf you are working on the server side, ts-node has been a huge timesaver. It removes the extra step of compiling and lets you just run your script with `ts-node script.ts` or even `#!/usr/bin/env ts-node` at the top of your file works. https://github.com/TypeStrong/ts-node https://github.com/TypeStrong/ts-node
- hasmolo 6y agobabel-node is also very nice, and more lenient about type checking. i've discovered nodemon with babel node gives me the ability to hack something together and adding a tsc build pipeline helps me correct the types when i'm done
- SavantIdiot 6y agoThanks for the node tip! I built an electron webpack framework and it uses hot reloads, but since i fork a lot of processes, it doesn't quite understand those need to be reloaded too! Got a fix for that by any chance?
- deckard1 6y agoFYI, tslint is deprecated since 2019. Most people use eslint. But eslint on TS is excruciatingly slow.