Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type-stripping in Node.js recommendations? #287

Open
marcomuser opened this issue Dec 13, 2024 · 4 comments
Open

type-stripping in Node.js recommendations? #287

marcomuser opened this issue Dec 13, 2024 · 4 comments

Comments

@marcomuser
Copy link

Node.js is adding native ts support. It would be great if the Node.js tsconfigs would follow the official recommendations: https://nodejs.org/docs/latest/api/typescript.html#type-stripping

@orta
Copy link
Member

orta commented Dec 14, 2024

I think we'd need a separate one for that, the type-stripping in node is experimental and requires flagging

@orta orta changed the title Follow Node.js recommendations type-stripping in Node.js recommendations? Dec 14, 2024
@jakebailey
Copy link

I'm not sure those are options that one should be enabling without understanding what you're doing already; those flags are also incomplete until TS adds the ability to block bad syntax and require .ts in imports as well.

@marcomuser
Copy link
Author

A separate tsconfig sounds reasonable! Would you then wait for the tsconfig option mentioned (reference for others: microsoft/TypeScript#59601), or could we go ahead and provide a “strip-types” tsconfig that could be kept in sync with the Node.js recommendations for this mode going forward?

@kachkaev
Copy link

kachkaev commented Jan 30, 2025

TypeScript 5.8 beta was just released with a new erasableSyntaxOnly option:
https://devblogs.microsoft.com/typescript/announcing-typescript-5-8-beta/#the---erasablesyntaxonly-option

It'd be great to see it as part of @tsconfig/strictest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants