Skip to content

Port TS PR #62669: Deprecate --module amd, umd, system, none; --moduleResolution classic#2818

Queued
Copilot wants to merge 4 commits intomainfrom
copilot/deprecate-module-types
Queued

Port TS PR #62669: Deprecate --module amd, umd, system, none; --moduleResolution classic#2818
Copilot wants to merge 4 commits intomainfrom
copilot/deprecate-module-types

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

Ports applicable parts of microsoft/TypeScript#62669 to the Go port.

Changes

  • Mark --module values as deprecated: Added none, amd, system, umd to commandLineOptionDeprecated, filtering them from --help output and error suggestion text
  • Add removal diagnostic for --moduleResolution classic: Emits "has been removed" when explicitly set, consistent with existing node10 handling
  • Update commented-out bundler check: Synced the dormant validation to match current TS (new diagnostic message, CommonJS exclusion)

Not ported

  • module: None removal diagnostic: ModuleKindNone = 0 is Go's zero value — indistinguishable from "not set"
  • GetModuleResolutionKind default change (deprecated modules → Classic): Classic resolution is unimplemented in the Go resolver; deprecated modules continue mapping to Bundler
  • completions.ts changes: Go port uses a different auto-import origin structure without Export/ResolvedExport flags

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…eResolution classic

- Add deprecated keys for module option (none, amd, system, umd)
- Add removal diagnostic for moduleResolution classic
- Update commented-out bundler check with new diagnostic and CommonJS exclusion
- Accept baseline changes for help output and error messages

Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Copilot AI changed the title [WIP] Port deprecation of module types and resolution settings Port TS PR #62669: Deprecate --module amd, umd, system, none; --moduleResolution classic Feb 18, 2026
Copilot AI requested a review from jakebailey February 18, 2026 04:17
@jakebailey jakebailey marked this pull request as ready for review March 24, 2026 22:48
Copilot AI review requested due to automatic review settings March 24, 2026 22:48
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 PR microsoft/TypeScript#62669 behavior into the Go port by deprecating legacy --module values, removing --moduleResolution classic, and aligning (currently disabled) bundler validation messaging.

Changes:

  • Hide deprecated --module values (none, amd, system, umd) from --help output and TS6046 suggestion text.
  • Emit a “has been removed” diagnostic when --moduleResolution classic is set.
  • Sync the commented-out bundler validation check to match upstream diagnostics/conditions (incl. CommonJS exclusion).

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty options of --module.js Updates TS6046 “must be” list to exclude deprecated --module values.
testdata/baselines/reference/tscWatch/commandLine/Parse-watch-interval-option-without-tsconfig.json.js Updates --help output for --module to exclude deprecated values.
testdata/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent.js Updates --help output for --module to exclude deprecated values.
testdata/baselines/reference/tsc/ignoreConfig/without-any-options-when-config-file-absent-with---ignoreConfig.js Updates --help output for --module to exclude deprecated values.
testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js Updates wrapped help text listing for --module to exclude deprecated values.
testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-cannot-provide-terminal-width.js Updates --help output for --module to exclude deprecated values.
testdata/baselines/reference/tsc/commandLine/help.js Updates --help output for --module to exclude deprecated values.
testdata/baselines/reference/tsc/commandLine/help-all.js Updates --help --all output for --module to exclude deprecated values.
testdata/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js Updates no-color help output for --module to exclude deprecated values.
testdata/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set-even-if-FORCE_COLOR-is-set.js Updates no-color + FORCE_COLOR help output for --module to exclude deprecated values.
testdata/baselines/reference/tsc/commandLine/adds-color-when-FORCE_COLOR-is-set.js Updates FORCE_COLOR help output for --module to exclude deprecated values.
internal/tsoptions/commandlineoption.go Marks legacy --module values as deprecated (so help/suggestions can filter them).
internal/compiler/program.go Adds removal diagnostic for moduleResolution=classic and updates commented-out bundler validation messaging/conditions.

// !!! Reenable once we don't map old moduleResolution kinds to bundler.
// if moduleResolution == core.ModuleResolutionKindBundler && !emitModuleKindIsNonNodeESM(moduleKind) && moduleKind != core.ModuleKindPreserve {
// createOptionValueDiagnostic("moduleResolution", diagnostics.Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later, "bundler")
// !!! Reenable once deprecated module kinds (AMD, UMD, System) don't map to bundler resolution.
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

The comment lists deprecated module kinds as “(AMD, UMD, System)”, but this PR also deprecates none (per metadata and commandLineOptionDeprecated). If none follows the same mapping behavior, the comment should include it (or be phrased more generally) to avoid future confusion when re-enabling this check.

Suggested change
// !!! Reenable once deprecated module kinds (AMD, UMD, System) don't map to bundler resolution.
// !!! Reenable once deprecated module kinds (AMD, UMD, System, none) don't map to bundler resolution.

Copilot uses AI. Check for mistakes.
@jakebailey jakebailey added this pull request to the merge queue Mar 25, 2026
Any commits made after this event will not be merged.
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 25, 2026
@jakebailey jakebailey added this pull request to the merge queue Mar 25, 2026
Any commits made after this event will not be merged.
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 25, 2026
@jakebailey jakebailey added this pull request to the merge queue Mar 25, 2026
Any commits made after this event will not be merged.
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 25, 2026
@jakebailey jakebailey added this pull request to the merge queue Mar 25, 2026
Any commits made after this event will not be merged.
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 25, 2026
@RyanCavanaugh RyanCavanaugh added this pull request to the merge queue Mar 25, 2026
Any commits made after this event will not be merged.
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