Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This isn't as bad as it sounds in practice. I'm usually glad it eliminates reflection which I've rarely seen used honorably... I do miss it occasionally.

Some popular typed languages, notably Java, do type erasure on objects as well. Extending that to value types feels right in a strange way, more consistent at least.

One thing I'll mention to make The a better experience... The compiler, even on the strictest options, will still let you do a lot of hacky old school JS crap. I HIGHLY recommend integrating TSLint with almost all rules turned on and Microsoft's contrib extension. It makes Typescript code almost bulletproof.

Use the Typescript language service and experimental plugin for VSCode to show both Typescript errors and TsLint errors live with intellisense. It's a pain to set all this up at first but the experience is slick.



On that note I wish tslint would stop trying to do code formatting rules. prettier nowadays does code formatting far better than tslint ever did.


I thought Prettier didn't support TypeScript, as the TS AST is completely different to the JS AST.


It's not very different; Typescript strives to be a JS superset.

Anyhow, it does support it just fine. Even tsx/jsx (react-extended js/ts).


:-) same here. Those are the few rules I shut off. TsLint really shines in static analysis.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: