Skip to content

Error on esModuleInterop=false and allowSyntheticDefaultImports=false (removed in TS7)#2759

Open
Copilot wants to merge 2 commits intomainfrom
copilot/error-out-deprecated-values
Open

Error on esModuleInterop=false and allowSyntheticDefaultImports=false (removed in TS7)#2759
Copilot wants to merge 2 commits intomainfrom
copilot/error-out-deprecated-values

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

Ports TypeScript#62567. Rather than deprecating esModuleInterop and allowSyntheticDefaultImports, these are treated as removed when set to false, consistent with other TS7 removals (baseUrl, outFile, module: AMD/System/UMD).

  • internal/tsoptions/declscompiler.go: esModuleInterop default changed from false to true (allowSyntheticDefaultImports was already true)
  • internal/compiler/program.go: Added createRemovedOptionDiagnostic for esModuleInterop=false and allowSyntheticDefaultImports=false in verifyCompilerOptions

GetESModuleInterop() and GetAllowSyntheticDefaultImports() already unconditionally return true.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…efaultImports=false

Change esModuleInterop default to true and add removed option diagnostics
for esModuleInterop=false and allowSyntheticDefaultImports=false in
verifyCompilerOptions, matching the pattern used for other options
removed in TS7.

Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement error handling for deprecated compiler options Error on esModuleInterop=false and allowSyntheticDefaultImports=false (removed in TS7) Feb 11, 2026
Copilot AI requested a review from jakebailey February 11, 2026 06:53
@jakebailey jakebailey marked this pull request as ready for review February 11, 2026 07:23
Copilot AI review requested due to automatic review settings February 11, 2026 07:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Ports TypeScript#62567 by aligning tsgo’s handling of esModuleInterop / allowSyntheticDefaultImports with TS7 semantics: these options are effectively always true, and explicitly setting them to false is treated as a removed-option error.

Changes:

  • Updated esModuleInterop help/default display to default: true.
  • Added TS5108 “option has been removed” diagnostics when esModuleInterop=false or allowSyntheticDefaultImports=false is explicitly set.
  • Refreshed multiple reference baselines affected by the help text and the new diagnostic.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

File Description
internal/tsoptions/declscompiler.go Changes esModuleInterop default value description to true for --help output.
internal/compiler/program.go Emits TS5108 removed-option diagnostics when either option is explicitly set to false.
testdata/baselines/reference/** Updates baselines for help output and tsbuild behavior reflecting the new diagnostics/default display.

Comment on lines +694 to +696
if options.AllowSyntheticDefaultImports.IsFalse() {
createRemovedOptionDiagnostic("allowSyntheticDefaultImports", "false", "")
}
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The PR adds a removed-option diagnostic for allowSyntheticDefaultImports=false, but the updated baselines only cover the esModuleInterop=false error path. Please add a baseline/test case that exercises allowSyntheticDefaultImports=false (e.g., a small tsbuild/tsc config) so this behavior is covered and won’t regress silently.

Copilot uses AI. Check for mistakes.
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.

2 participants