Skip to content

test(linter/plugins): conformance tester error on test cases with custom parsers#16716

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-11-test_linter_plugins_conformance_tester_error_on_test_cases_with_custom_parsers
Dec 11, 2025
Merged

test(linter/plugins): conformance tester error on test cases with custom parsers#16716
graphite-app[bot] merged 1 commit intomainfrom
12-11-test_linter_plugins_conformance_tester_error_on_test_cases_with_custom_parsers

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Dec 11, 2025

Some ESLint test cases provide a custom parser. We cannot easily support that, so just throw an error if a custom parser is provided.

Some of these cases were previously passing (Oxc managed to parse them), but some were not. It's hard when debugging to figure out for each test case whether it should be failing or not due to absence of custom parser, so simpler to just error for them all at this stage.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins C-test Category - Testing. Code is missing test cases, or a PR is adding them labels Dec 11, 2025
Copy link
Copy Markdown
Member Author

overlookmotel commented Dec 11, 2025


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.

Copy link
Copy Markdown
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 explicit error handling for ESLint test cases that specify custom parsers. Since Oxc cannot easily support custom parsers, the PR throws a clear error message when they are encountered, replacing the previous generic "Parsing failed" errors. The conformance tester already has special handling for @typescript-eslint/parser which converts it to parserOptions.lang, so that parser continues to work.

Key changes:

  • Removed parser property from LanguageOptions interface to prevent accidental usage
  • Added runtime check in getParseOptions() to throw "Custom parsers are not supported" error
  • Updated conformance tester to use type assertion for accessing parser property when checking for @typescript-eslint/parser

Reviewed changes

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

File Description
apps/oxlint/src-js/package/rule_tester.ts Removed parser property from LanguageOptions type definition and added runtime check to throw error if custom parser is detected
apps/oxlint/conformance/src/rule_tester.ts Added LanguageOptionsWithParser type and updated type assertion to safely access parser property for @typescript-eslint/parser detection
apps/oxlint/conformance/snapshot.md Updated test results showing changed error messages and test counts reflecting the new custom parser rejection behavior

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

@overlookmotel overlookmotel force-pushed the 12-11-test_linter_plugins_conformance_tester_error_on_test_cases_with_custom_parsers branch from 632bd1b to ee3aae5 Compare December 11, 2025 02:09
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app bot commented Dec 11, 2025

Merge activity

…tom parsers (#16716)

Some ESLint test cases provide a custom parser. We cannot easily support that, so just throw an error if a custom parser is provided.

Some of these cases were previously passing (Oxc managed to parse them), but some were not. It's hard when debugging to figure out for each test case whether it should be failing or not due to absence of custom parser, so simpler to just error for them all at this stage.
@graphite-app graphite-app bot force-pushed the 12-11-test_linter_plugins_conformance_tester_error_on_test_cases_with_custom_parsers branch from ee3aae5 to 773d34d Compare December 11, 2025 02:17
@graphite-app graphite-app bot merged commit 773d34d into main Dec 11, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 12-11-test_linter_plugins_conformance_tester_error_on_test_cases_with_custom_parsers branch December 11, 2025 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins 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.

2 participants