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

Add recommended configuration for Node.js running TS natively #293

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

khaosdoctor
Copy link

I'm adding the recommended file for node.js if you're running it with TypeScript type stripping through --experimental-strip-types

This is part of our roadmap.

bases/node-ts.json Outdated Show resolved Hide resolved
Comment on lines +7 to +13
"module": "node16",
"target": "es2024",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node16",
"erasableSyntaxOnly": true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"module": "node16",
"target": "es2024",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node16",
"erasableSyntaxOnly": true
"erasableSyntaxOnly": true

I was actually sort of thinking this, but removing options already set by say, @types/node22, that leaves this config empty, which I think is pretty weird, so maybe this is a bad idea and we should just have this be more fleshed out. Not sure...

Copy link
Author

@khaosdoctor khaosdoctor Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally thought this as well, but then in this case the file would always need to be extended from another file, if we keep the settings, it becomes standalone but also extendable as long as it comes first in the stack.

We could also add the extends ourselves to extend Node22 and add the erasable syntax option

Copy link
Member

@orta orta Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extends is an array in modern typescript right?

So it could be made to expect ["@tsconfig/bases/node22", "@tsconfig/bases/node-strip-types"] or similar?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that was our idea originally, but then if someone wants to use it as a standalone without any other extends it will also have it ready (or we can pre-add the extends)

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

Successfully merging this pull request may close these issues.

3 participants