Skip to content

Add missing APIs needed by typescript-eslint - #64264

Merged
Andrew Branch (andrewbranch) merged 4 commits into
microsoft:mainfrom
andrewbranch:typescript-eslint-missing-apis
Sep 14, 2026
Merged

Andrew Branch (andrewbranch) merged 4 commits into
microsoft:mainfrom
andrewbranch:typescript-eslint-missing-apis

Conversation

@andrewbranch

@andrewbranch Andrew Branch (andrewbranch) commented Sep 14, 2026

Copy link
Copy Markdown
Member

Adds the APIs mentioned by typescript-eslint/typescript-eslint#12803, except program.sourceFileToPackageName, which was internal and doesn't exist in the Go code, and Signature JSDoc methods, which should just go through the declaration for now as the PR currently does. Also corrects the JsxEmit.React/JsxEmit.ReactNative numeric value change from Strada.

Copilot AI balanced review requested due to automatic review settings September 14, 2026 18:53
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Sep 14, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 14, 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.

🔵 Needs a closer look

The parity surface omits a required checker API and exposes an unsafe contextual-type parameter.

Pull request overview

Adds native TypeScript API parity required by typescript-eslint and aligns JSX enum values with Strada.

Changes:

  • Adds checker, signature, index, and interface-this APIs.
  • Adds sync/async API parity tests and protocol support.
  • Corrects JsxEmit.React and ReactNative values.
File summaries
File Description
tsc/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js Updates JSX build-info baseline.
tsc/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with compilerOptions, files, include, and exclude with jsonSourceFile api.js Updates parsed JSX value.
tsc/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with compilerOptions, files, include, and exclude with json api.js Updates parsed JSX value.
tsc/internal/ls/jsdoc.go Generalizes declaration JSDoc extraction.
tsc/internal/core/compileroptions.go Corrects JSX enum values.
tsc/internal/checker/types.go Adds IndexKind and interface-this access.
tsc/internal/checker/exports.go Exposes awaited and index-type operations.
tsc/internal/api/session.go Implements new protocol handlers.
tsc/internal/api/proto.go Defines methods, parameters, and response metadata.
tsc/internal/api/enum_values_generated.go Exports new enum values.
packages/typescript/test/sync/api.test.ts Tests synchronous API parity.
packages/typescript/test/sync/api-generators.test.ts Tests generator parity.
packages/typescript/test/async/api.test.ts Tests asynchronous API parity.
packages/typescript/src/enums/jsxEmit.ts Updates generated JSX enum.
packages/typescript/src/enums/jsxEmit.enum.ts Updates JSX enum declaration.
packages/typescript/src/enums/indexKind.ts Adds generated IndexKind.
packages/typescript/src/enums/indexKind.enum.ts Adds IndexKind declaration.
packages/typescript/src/api/sync/types.ts Adds synchronous interface-this API type.
packages/typescript/src/api/sync/api.ts Adds synchronous API implementations.
packages/typescript/src/api/proto.generated.ts Updates generated protocol types.
packages/typescript/src/api/async/types.ts Adds asynchronous interface-this API type.
packages/typescript/src/api/async/api.ts Adds asynchronous API implementations.
Herebyfile.mjs Registers IndexKind generation.
Review details

Files not reviewed (1)

  • tsc/internal/api/enum_values_generated.go: Generated file

Suppressed comments (2)

packages/typescript/src/api/async/api.ts:1809

  • The public parameter is broader than the operation supports. Expression allows identifiers, literals, and other non-call nodes, but the backend passes this node to resolveSignature, whose default case panics for anything outside CallLikeExpression (tsc/internal/checker/checker.go:8620-8635). The classic API contract is also CallLikeExpression (tsc/testdata/fixtures/compiler/types.ts:5230). Please narrow this parameter in the async source and regenerate the sync API so a type-correct client call cannot crash the server.
            positions: positionOrPositions,

packages/typescript/src/api/async/api.ts:2104

  • The stated parity scope still omits TypeChecker.getTypeOfPropertyOfType, which the linked typescript-eslint PR lists among the required recreated APIs. The Go checker already exposes the primitive at tsc/internal/checker/exports.go:263-265, but there is no protocol or async/sync client method, so consumers still cannot use it through this API. Please expose it alongside these checker methods and cover it in the parity tests.
    async getReturnTypeOfSignature(signature: Signature): Promise<Type> {
  • Files reviewed: 22/23 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

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.

🟡 Changes recommended

Signature documentation and tag APIs do not preserve classic inherited JSDoc behavior.

Get a fresh assessment by requesting another Copilot review.

Review details

Files not reviewed (1)

  • tsc/internal/api/enum_values_generated.go: Generated file

Suppressed comments (1)

tsc/internal/api/session.go:4084

  • This path does not fully match classic Signature.getDocumentationComment() inheritance: a derived method with an empty JSDoc or @inheritDoc has a local JSDoc node, so getJSDocOrTag stops there and this returns an empty comment instead of the base method's documentation. Please explicitly fall back to/merge base declaration documentation when the local result is empty or contains @inheritDoc, and cover that case in the parity tests.
	return ls.GetDocumentationComment(setup.checker, []*ast.Node{signature.Declaration()}), nil
  • Files reviewed: 22/23 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread tsc/internal/api/session.go Outdated

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.

🟢 Approval recommended

The protocol, client implementations, generated enums, baselines, and parity tests are consistent and complete.

Review details

Files not reviewed (1)

  • tsc/internal/api/enum_values_generated.go: Generated file
  • Files reviewed: 22/23 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Comment thread tsc/internal/ls/jsdoc.go
@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Sep 14, 2026
@andrewbranch
Andrew Branch (andrewbranch) added this pull request to the merge queue Sep 14, 2026
Merged via the queue into microsoft:main with commit 57d9528 Sep 14, 2026
26 checks passed
@andrewbranch
Andrew Branch (andrewbranch) deleted the typescript-eslint-missing-apis branch September 14, 2026 23:28
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Sep 14, 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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants