-
Notifications
You must be signed in to change notification settings - Fork 12
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
Switch module config in tsconfig.json #346
Conversation
"module": "Preserve" more closely matches what bundlers do than "module": "ESNext" - https://twitter.com/mattpocockuk/status/1766064573130444872 - https://www.totaltypescript.com/tsconfig-cheat-sheet#not-transpiling-with-typescript
@ProchaLu if you could test this on all of our supported project environments, then we can go ahead with this one:
|
It is important to update the TypeScript version to Node.jsUpdated the {
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "eslint-config-upleveled/tsconfig.base.json",
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext"
},
"include": [
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.jsx",
"**/*.cjs",
"**/*.mjs"
]
}
|
Looks like Next.js ( |
Switch
"module"
config intsconfig.json
:"module": "ESNext"
to"module": "Preserve"
for bundler environments"module": "ESNext"
to"module": "NodeNext"
for Node.js"moduleResolution": "Bundler"
to"moduleResolution": "NodeNext"
for Node.jsReasoning
"module": "Preserve"
more closely matches what bundlers do than"module": "ESNext"
:"module": "NodeNext"
and"moduleResolution": "NodeNext"
should be used if transpiling withtsc
(which would be the case for Node.js projects)