Skip to content

Conversation

@jakebailey
Copy link
Member

@jakebailey jakebailey commented Nov 9, 2025

Probably a typo, plus one !!! fix.

Copilot AI review requested due to automatic review settings November 9, 2025 06:57
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

This PR fixes a bug in module detection logic for Node18 module kind and refactors the code for better maintainability. The original switch statement inadvertently omitted ModuleKindNode18, causing incorrect module detection behavior.

  • Fixed missing ModuleKindNode18 in GetEmitModuleDetectionKind()
  • Refactored switch statement to range comparison for cleaner code
  • Reduced test baseline diffs, indicating better convergence with TypeScript behavior

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/core/compileroptions.go Fixed bug where ModuleKindNode18 was missing from module detection logic; refactored switch to range comparison
testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node18).js.diff Reduced diff showing convergence with TypeScript for Node18 module handling
testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node18).js Updated baseline reflecting correct Node18 behavior with __esModule marker
testdata/baselines/reference/submodule/compiler/tripleSlashTypesReferenceWithMissingExports(module=node18).js.diff Eliminated diff entirely, indicating full convergence with TypeScript behavior
testdata/baselines/reference/submodule/compiler/tripleSlashTypesReferenceWithMissingExports(module=node18).js Updated baseline reflecting correct Node18 module preamble emission

@jakebailey jakebailey changed the title Fix moduleDetection for node18 Fix moduleDetection for node18, fix __esModule in detect=force Nov 10, 2025
@jakebailey jakebailey added this pull request to the merge queue Nov 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 10, 2025
@jakebailey jakebailey added this pull request to the merge queue Nov 10, 2025
Merged via the queue into main with commit ea4e944 Nov 10, 2025
22 checks passed
@jakebailey jakebailey deleted the jabaile/module-detection-misport branch November 10, 2025 20:11
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.

4 participants