Port TS PR #62669: Deprecate --module amd, umd, system, none; --moduleResolution classic#2818
Queued
Port TS PR #62669: Deprecate --module amd, umd, system, none; --moduleResolution classic#2818
Conversation
…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
Contributor
There was a problem hiding this comment.
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
--modulevalues (none,amd,system,umd) from--helpoutput and TS6046 suggestion text. - Emit a “has been removed” diagnostic when
--moduleResolution classicis 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. |
internal/compiler/program.go
Outdated
| // !!! 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. |
There was a problem hiding this comment.
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. |
RyanCavanaugh
approved these changes
Mar 24, 2026
Any commits made after this event will not be merged.
Any commits made after this event will not be merged.
Any commits made after this event will not be merged.
Any commits made after this event will not be merged.
Any commits made after this event will not be merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports applicable parts of microsoft/TypeScript#62669 to the Go port.
Changes
--modulevalues as deprecated: Addednone,amd,system,umdtocommandLineOptionDeprecated, filtering them from--helpoutput and error suggestion text--moduleResolution classic: Emits "has been removed" when explicitly set, consistent with existingnode10handlingCommonJSexclusion)Not ported
module: Noneremoval diagnostic:ModuleKindNone = 0is Go's zero value — indistinguishable from "not set"GetModuleResolutionKinddefault change (deprecated modules → Classic): Classic resolution is unimplemented in the Go resolver; deprecated modules continue mapping to Bundlercompletions.tschanges: Go port uses a different auto-import origin structure withoutExport/ResolvedExportflags💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.