Hacker News new | ask | show | jobs
by iainmerrick 1362 days ago
TypeScript has lots of great features and a few bizarrely bad ones. It’s great in spite of itself.

The main misfeature is their dogmatic refusal to rewrite import paths (citing the “Preserve runtime behavior of all JavaScript code” principle mentioned in this article). Here’s a good summary of the problems this causes: https://github.com/microsoft/TypeScript/issues/42151

I’m curious, how many people are using TSC only for type-checking, and a different system (eg esbuild or ts-node) to actually compile/bundle/execute their code?

I think TypeScript would be even stronger if they focused fully on type-checking, and relaxed some of those dogmatic restrictions (and the many, many confusing config options) imposed by the JS code generator.

1 comments

They're beginning to yield on file suffixes, and even have module resolution tracked on the 4.9 iteration plan. I agree it’d be better for them to focus on type checking but gratefully that’s what they seem to be moving towards with their types as comments proposal.