Uh oh!
There was an error while loading. Please reload this page.
Deprecate esModuleInterop and allowSyntheticDefaultImports (default to true) - #62567
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements default esModuleInterop and allowSyntheticDefaultImports behavior while deprecating explicit false settings. The changes update TypeScript's module interoperability to behave as if these options are always enabled, which affects how import statements are transpiled to CommonJS.
Key changes:
- Updates module import transpilation to use import helpers by default
- Adds deprecation warnings for explicit false settings of esModuleInterop and allowSyntheticDefaultImports
- Modifies type resolution for dynamic imports to include default export wrappers
Reviewed Changes
Copilot reviewed 300 out of 459 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/baselines/reference/moduleExportAliasImported.types | Updates type expectations for dynamic imports to include default wrapper |
| tests/baselines/reference/moduleAugmentationDoesNamespaceEnumMergeOfReexport.js | Adds import helper functions for namespace imports |
| tests/baselines/reference/mergedDeclarations7.js | Includes __importStar helper for require() calls |
| tests/baselines/reference/legacyNodeModulesExportsSpecifierGenerationConditions.js | Wraps dynamic imports with __importStar helper |
| tests/baselines/reference/keyofModuleObjectHasCorrectKeys.js | Uses __importStar for namespace imports |
| tests/baselines/reference/jsxViaImport.2.js | Adds __importDefault helper for default imports |
| tests/baselines/reference/jsxSpreadFirstUnionNoErrors.js | Uses __importDefault for React import |
| Multiple JSX test files | Consistently use __importStar for React namespace imports |
| Multiple import test files | Add import helper functions and update error messages for deprecated options |
| tests/baselines/reference/importAttributes9.* | Updates dynamic import type resolution |
Uh oh!
There was an error while loading. Please reload this page.
Jake Bailey (jakebailey)
commented
Oct 22, 2025
Uh oh!
There was an error while loading. Please reload this page.
Andrew Branch (andrewbranch)
commented
Oct 22, 2025
I'll fix anything that turns up on DT tomorrow |
TypeScript Bot (typescript-bot)
commented
Oct 23, 2025
Hey Jake Bailey (@jakebailey), the results of running the DT tests are ready. There were interesting changes: Changes are too big to display here, please check the log. |
Jake Bailey (jakebailey)
commented
Oct 23, 2025
Uh oh |
LukeAbby
commented
Dec 15, 2025
Heads up, because there's no issue with "Breaking Change" the only way I discovered this was by having the error and finding this PR. Not sure how big of a deal that is though. |
Closes#62529