test(linter/plugins): conformance tester error on test cases with custom parsers#16716
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
There was a problem hiding this comment.
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
parserproperty fromLanguageOptionsinterface 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.
632bd1b to
ee3aae5
Compare
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.
ee3aae5 to
773d34d
Compare

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.