Skip to content

[api] Parse tsconfig plugins for external error reporting, expose MappedType properties - #64397

Merged
Andrew Branch (andrewbranch) merged 2 commits into
microsoft:mainfrom
andrewbranch:agents/fix-mapped-type-internals-tsconfig-plugins
Sep 23, 2026
Merged

Andrew Branch (andrewbranch) merged 2 commits into
microsoft:mainfrom
andrewbranch:agents/fix-mapped-type-internals-tsconfig-plugins

Conversation

@andrewbranch

Copy link
Copy Markdown
Member

Fixes the next two (last two?) things typescript-eslint asked for.

Copilot AI balanced review requested due to automatic review settings September 22, 2026 23:05
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Sep 22, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Mapped types returned through some response paths lack required component handles.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds tsconfig plugin metadata parsing and exposes mapped-type components through sync and async APIs.

Changes:

  • Preserves plugin names in parsed compiler options.
  • Adds mapped-type protocol fields, accessors, and guards.
  • Adds sync, async, and generator tests.

Review findings:

  • Moderate: session.go does not enrich mapped types returned through all response paths, causing missing component handles and runtime failures.
  • Nit: Add standalone isMappedType guards to both sync and async APIs for consistency.
File Description
tsc/​internal/​tsoptions/​parsinghelpers.go Parses plugin entries.
tsc/​internal/​core/​compileroptions.go Models plugin configuration.
tsc/​internal/​checker/​types.go Exposes mapped-type components.
tsc/​internal/​api/​session.go Serves mapped-type data.
tsc/​internal/​api/​proto.go Defines protocol additions.
packages/​typescript/​test/​sync/​api.test.ts Tests synchronous behavior.
packages/​typescript/​test/​sync/​api-generators.test.ts Tests generator parity.
packages/​typescript/​test/​async/​api.test.ts Tests asynchronous behavior.
packages/​typescript/​src/​api/​sync/​types.ts Declares synchronous mapped types.
packages/​typescript/​src/​api/​sync/​api.ts Implements synchronous accessors.
packages/​typescript/​src/​api/​proto.generated.ts Updates generated protocol types.
packages/​typescript/​src/​api/​async/​types.ts Declares asynchronous mapped types.
packages/​typescript/​src/​api/​async/​api.ts Implements asynchronous accessors.
.github/​skills/​api-client/​SKILL.md Documents API property conventions.
Comment thread tsc/internal/api/session.go Resolved
UseUnknownInCatchVariables Tristate `json:"useUnknownInCatchVariables,omitzero"`
VerbatimModuleSyntax Tristate `json:"verbatimModuleSyntax,omitzero"`
MaxNodeModuleJsDepth *int `json:"maxNodeModuleJsDepth,omitzero"`
// Plugins are parsed only so tools can report that native TypeScript does not support them.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where do we report that? I don't see any code adding errors or tests that show it, so not sure where they are.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We don't (maybe we should?)—relevant word here is tools. typescript-eslint asked to be able to report this, since I guess by nature of using ProjectService, they previously supported plugins.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Like some other things, though, I'm not sure how I feel about erroring on it at this point, since that could make it hard to use a side-by-side TS 6/7 setup where you're getting some value out of your plugins in TS 6, but can use TS 7 for the CLI.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fair, I just read the comment as it implying we checked

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Six unresolved moderate issues affect configuration semantics, rebuild behavior, API exports, protocol nullability, and request concurrency.

Review effort: Balanced
Findings: None

Resolved since last review (1)
@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Sep 23, 2026
@andrewbranch
Andrew Branch (andrewbranch) added this pull request to the merge queue Sep 23, 2026
Merged via the queue into microsoft:main with commit 1878c5e Sep 23, 2026
29 checks passed
@andrewbranch
Andrew Branch (andrewbranch) deleted the agents/fix-mapped-type-internals-tsconfig-plugins branch September 23, 2026 00:48
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

3 participants