Skip to content

Comments

Port TypeScript PR #62338: Deprecate --moduleResolution node10#2817

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/deprecate-module-resolution-node10
Draft

Port TypeScript PR #62338: Deprecate --moduleResolution node10#2817
Copilot wants to merge 3 commits intomainfrom
copilot/deprecate-module-resolution-node10

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

Ports microsoft/TypeScript#62338 to the Go codebase.

Core changes

  • internal/compiler/program.go: Add moduleResolution: node10 to the removed options list (TS7+ treats 6.0 deprecations as removed)
  • internal/ast/utilities.go: Add IsVariableDeclarationInitializedToBareOrAccessedRequire and GetModuleSpecifierOfBareOrAccessedRequire — handles accessed require patterns like require("foo").bar in addition to bare require("foo")
  • internal/checker/checker.go: Use the new utilities in resolveExternalModule to correctly resolve module specifiers from accessed require calls

Test updates

  • internal/execute/tsctests/tscbuild_test.go: Removed explicit "moduleResolution": "node" from resolveJsonModule tsbuild test configs so they default to bundler
  • internal/execute/tsctests/tsc_test.go: Removed explicit "moduleResolution": "node" from pnpm-style-layout tsc test config so it defaults to bundler

Already ported (no changes needed)

  • Default moduleResolution for --module commonjsbundler (GetModuleResolutionKind already maps this)
  • exportsOrImportsLookup returning bool in string_completions.go
  • detailsEntryId completions fix not applicable (pattern absent in Go port)

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

…ort getModuleSpecifierOfBareOrAccessedRequire, update checker

Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Copilot AI changed the title [WIP] Port deprecation of --moduleResolution node10 Port TypeScript PR #62338: Deprecate --moduleResolution node10 Feb 18, 2026
Copilot AI requested a review from jakebailey February 18, 2026 03:58

tsgo --b project --v --explainFiles --listEmittedFiles
ExitStatus:: Success
ExitStatus:: DiagnosticsPresent_OutputsGenerated
Copy link
Member

Choose a reason for hiding this comment

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

@copilot Change all of these tests to not use node10, but some other resolution mode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed "moduleResolution": "node" from both the resolveJsonModule tsbuild test and the pnpm-style-layout tsc test configs. They now default to bundler instead. Baselines updated accordingly in 3dd2c9c.

…configs instead

Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
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