Skip to content

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Nov 10, 2025

Finally fixes #11582

This PR adds a script that generates a list of TSC error codes.

The codes are collected based on the TypeScript version managed by just submodules.
And the list is then committed to Git.

When the submodule version is updated, the script is also called and the list is regenerated.

If TSC introduces new diagnostic codes, the diff will show the added code, which we need to review.
Either leave it for the parser to report or ignore it if we cannot support it.

Copilot AI review requested due to automatic review settings November 10, 2025 05:05
@github-actions github-actions bot added the C-test Category - Testing. Code is missing test cases, or a PR is adding them label Nov 10, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@leaysgur leaysgur force-pushed the 11-10-test_coverage_typescript_add_reviewed_tsc_diagnostics_error_codes branch from ca9169a to ed45a7d Compare November 10, 2025 05:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new script to generate and maintain a reviewed list of TypeScript diagnostic error codes from the TypeScript compiler's test baselines. The script helps track which error codes can be detected by oxc_parser during static parsing versus those requiring type information.

Key changes:

  • New TypeScript script to extract diagnostic error codes from TypeScript's .errors.txt test baseline files
  • Generated list of 1008 unique diagnostic error codes in reviewed-diagnostic-error-codes.txt
  • Integration with the build system via justfile command update-tsc-diagnostics-codes

Reviewed Changes

Copilot reviewed 2 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tasks/coverage/tsc-diagnostics-codes/package.json New package configuration with tinyglobby dependency for glob operations
tasks/coverage/tsc-diagnostics-codes/main.ts Script that collects TypeScript test files, extracts error codes, and generates the reviewed list
tasks/coverage/reviewed-diagnostic-error-codes.txt Generated list of TypeScript diagnostic error codes to be reviewed for OXC support
pnpm-workspace.yaml Adds the new tsc-diagnostics-codes task to the workspace
pnpm-lock.yaml Locks tinyglobby dependency version for the new task
justfile Adds update-tsc-diagnostics-codes command to update the error codes list
.gitignore Ignores node_modules for the new task directory
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@leaysgur leaysgur force-pushed the 11-10-test_coverage_typescript_add_reviewed_tsc_diagnostics_error_codes branch from ed45a7d to 834ca4e Compare November 10, 2025 05:11
@leaysgur leaysgur requested a review from Boshen November 10, 2025 05:20
Copy link
Member

@Boshen Boshen left a comment

Choose a reason for hiding this comment

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

I'm not comfortable maintaining another submodule 😢 please let me study what this PR is actually doing first.

@Boshen
Copy link
Member

Boshen commented Nov 13, 2025

Opps I'm mistake, there is actually no submodule, just a task.

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Nov 13, 2025
Copy link
Member

Boshen commented Nov 13, 2025

Merge activity

  • Nov 13, 1:05 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Nov 13, 1:06 PM UTC: Boshen added this pull request to the Graphite merge queue.
  • Nov 13, 1:07 PM UTC: The Graphite merge queue couldn't merge this PR because it was in draft mode.

…15542)

Finally fixes #11582

This PR adds a script that generates a list of TSC error codes.

The codes are collected based on the TypeScript version managed by `just submodules`.
And the list is then committed to Git.

When the submodule version is updated, the script is also called and the list is regenerated.

If TSC introduces new diagnostic codes, the diff will show the added code, which we need to review.
Either leave it for the parser to report or ignore it if we cannot support it.
@graphite-app graphite-app bot force-pushed the 11-10-test_coverage_typescript_add_reviewed_tsc_diagnostics_error_codes branch from 834ca4e to 1d8832d Compare November 13, 2025 13:06
@Boshen Boshen removed the 0-merge Merge with Graphite Merge Queue label Nov 13, 2025
@Boshen Boshen marked this pull request as draft November 13, 2025 13:06
Copy link
Member

@Boshen Boshen left a comment

Choose a reason for hiding this comment

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

This should be part of the conformance runner instead of separate js task, which I assume is slow.

I'll get claude to work on this at some point.

@leaysgur
Copy link
Member Author

Then, my Claude will do it tomorrow morning. 🫡

@leaysgur
Copy link
Member Author

#15686

@leaysgur leaysgur closed this Nov 16, 2025
@leaysgur leaysgur deleted the 11-10-test_coverage_typescript_add_reviewed_tsc_diagnostics_error_codes branch November 16, 2025 12:01
graphite-app bot pushed a commit that referenced this pull request Nov 16, 2025
…15686)

Fixes #11582, obsoletes #15542

This time, when you run `cargo run -p oxc_coverage -- parser`, automatically save codes as a snapshot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-test Category - Testing. Code is missing test cases, or a PR is adding them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parser: Improve TS error story

3 participants