Repository navigation
[api] Parse tsconfig plugins for external error reporting, expose MappedType properties - #64397
Conversation
There was a problem hiding this comment.
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
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.godoes not enrich mapped types returned through all response paths, causing missing component handles and runtime failures. - Nit: Add standalone
isMappedTypeguards 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. |
| 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. |
There was a problem hiding this comment.
Where do we report that? I don't see any code adding errors or tests that show it, so not sure where they are.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Fair, I just read the comment as it implying we checked
There was a problem hiding this comment.
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

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