Skip to content

Update module default value in tsconfigRules - #3608

Open
Jon Koops (jonkoops) wants to merge 1 commit into
microsoft:v2from
jonkoops:fix/update-module-default-value
Open

Jon Koops (jonkoops) wants to merge 1 commit into
microsoft:v2from
jonkoops:fix/update-module-default-value

Conversation

@jonkoops

@jonkoops Jon Koops (jonkoops) commented Jul 9, 2026 •

Copy link
Copy Markdown

The documented default value for the module compiler option is outdated since TypeScript 6.0.

In TypeScript 5.x, the default was "CommonJS if target is ES5; ES2015 otherwise". In TypeScript 6.0, the target default changed to es2025 and the module computation was updated to:

  • ESNext if target is ESNext
  • ES2022 if target is ES2022 or higher
  • ES2020 if target is ES2020 or higher
  • ES2015 if target is ES2015 or higher
  • CommonJS otherwise

The relevant computation logic in the compiler:

https://github.com/microsoft/TypeScript/blob/b24015058ae060de249acf5ea09e15dd92a55587/src/compiler/utilities.ts#L9055-L9076

Fixes microsoft/TypeScript#63330
Relates to microsoft/TypeScript#63392

@jonkoops
Jon Koops (jonkoops) force-pushed the fix/update-module-default-value branch from 0c5a837 to 16f13b4 Compare July 9, 2026 08:00
Signed-off-by: Jon Koops <jonkoops@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant