Hacker News new | ask | show | jobs
by jannes 1608 days ago
The TypeScript ecosystem is bigger than just the official compiler, though. Many projects use alternative compilers like esbuild or @babel/preset-typescript for their main pipeline and only use the official TypeScript compiler as a typechecker (with `--noEmit`, during CI).

It's true that enums are harder to support for alternative compilers. Especially `const enum` seems to be harder.

2 comments

> It's true that enums are harder to support for alternative compilers.

As long as it is supported — and at least esbuild does, who cares (as a user). Should I start avoiding every JS feature that is hard to implement in alternative JS runtimes?

I don't know why you should care if it doesn't affect you.

At least TypeScript cares enough to have added the `isolatedModules` and the `preserveValueImports` flags:

https://www.typescriptlang.org/tsconfig#isolatedModules

https://www.typescriptlang.org/tsconfig#preserveValueImports

yes, we should also restrict every C++ feature to what Borland Turbo C++ 3 supports too, since there are still school that teach that making it part of the C++ ecosystem.

Actually, as Amish communities are part of the human ecosystem, maybe we should also restrict anything we build in the real world to something that can be useful to the Amish and stop building anything requiring a power grid ?