3 ms·
Isn't that mostly just enums? Is there anything else that doesn't run as valid JS if you strip the types (and maybe some other extra keywords)out? Genuine que
by ifwinterco 6mo ago
Isn't that mostly just enums?
Is there anything else that doesn't run as valid JS if you strip the types (and maybe some other extra keywords)out?
Genuine question, in my head there's not much, but TS has a few weird corners I maybe haven't used
- silverwind 6mo agohttps://www.typescriptlang.org/tsconfig/#erasableSyntaxOnly https://www.typescriptlang.org/tsconfig/#erasableSyntaxOnly covers them all, I strongly recommend running with that option enabled to be future-proof.
- n_e 6mo agoenums and decorators mainly. There are also subtleties such as having the ts file extension in imports. Also imports aren't transpiled in cjs so you need to need es modules. I'm using it in my projects with no issues.
- ifwinterco 6mo agoAh yeah I forgot about decorators - I’ve worked with angular before but clearly I managed to erase all knowledge of it from my brain. Outside of that I’ve barely seen them used in typescript, they’re not really idiomatic in react projects