Skip to content

Port TypeScript PR #63054: Default types to [], support "*" wildcard#2688

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/port-typescript-pull-63054
Draft

Port TypeScript PR #63054: Default types to [], support "*" wildcard#2688
Copilot wants to merge 2 commits intomainfrom
copilot/port-typescript-pull-63054

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

Ports microsoft/TypeScript#63054. Changes default behavior: when types is unset, no @types packages are auto-discovered. Use types: ["*"] for the previous behavior.

Core Changes

  • internal/core/compileroptions.go: Add UsesWildcardTypes() method—returns true if types contains "*"
  • internal/module/resolver.go: Update GetAutomaticTypeDirectiveNames():
    • No wildcard → return types directly (or [] if nil)
    • Wildcard present → enumerate type roots, substitute "*" with discovered packages, deduplicate
  • internal/checker/checker.go: Swap diagnostic message selection logic—now suggests adding to types when wildcards are NOT in use
  • internal/compiler/fileInclude.go: Update automatic type directive file diagnostics to use new wildcard check

Example

// Old behavior (auto-discover all @types)
{ "compilerOptions": { } }

// New equivalent (explicit wildcard)
{ "compilerOptions": { "types": ["*"] } }

// Explicit subset only
{ "compilerOptions": { "types": ["node", "jest"] } }

// Mix explicit + wildcard
{ "compilerOptions": { "types": ["my-special-types", "*"] } }

Test Updates

  • Baseline changes reflect updated error messages (TS2580 → TS2591 with types field instructions)
  • Two fourslash tests added to failingTests.txt—depend on old auto-discovery behavior, will resolve when TypeScript submodule updates
Original prompt

Port microsoft/TypeScript#63054

Custom agent used: Strada to Corsa Port Expert
A Go and TypeScript expert who can easily figure out how to port PRs from one language to another


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

… `"*"` wildcard

Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Copilot AI changed the title [WIP] Port TypeScript pull request 63054 Port TypeScript PR #63054: Default types to [], support "*" wildcard Feb 5, 2026
Copilot AI requested a review from RyanCavanaugh February 5, 2026 01:06
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