-
Notifications
You must be signed in to change notification settings - Fork 251
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
base: main
Are you sure you want to change the base?
Conversation
"module": "node16", | ||
"target": "es2024", | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"moduleResolution": "node16", | ||
"erasableSyntaxOnly": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"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...
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
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.