test(linter/plugins): conformance tests ignore parsing errors#16717
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 improves conformance test compatibility with ESLint's test suite by enabling non-fatal parsing error handling. ESLint test cases often include intentionally invalid code (e.g., syntax errors, duplicate parameters) to verify that rules correctly handle edge cases. By setting parserOptions.ignoreNonFatalErrors = true, the parser can produce valid ASTs from code with non-fatal errors, allowing these tests to proceed and rules to be evaluated.
Key changes:
- Modified conformance test setup to unconditionally set
ignoreNonFatalErrors = truefor all test cases - Refactored test case modification logic to create new
languageOptionsandparserOptionsobjects before TypeScript parser handling - Improved test pass rates: 177 rules now fully passing (up from 171), with 69 additional tests passing overall
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/oxlint/conformance/src/rule_tester.ts | Refactored modifyTestCase to unconditionally enable ignoreNonFatalErrors for all conformance tests, and restructured object creation to happen before TypeScript parser detection |
| apps/oxlint/conformance/snapshot.md | Updated test results showing improved pass rates across multiple rules (accessor-pairs, class-methods-use-this, default-param-last, func-style, grouped-accessor-pairs, init-declarations, no-array-constructor, no-dupe-class-members, no-restricted-imports, no-shadow-restricted-names, no-useless-constructor, prefer-arrow-callback, strict) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
632bd1b to
ee3aae5
Compare
f0a3eb7 to
20b5b7c
Compare
Merge activity
|
ESLint's has many test cases with invalid code. Loosen parsing in conformance test, so parsing only errors if there's a fatal error, and allow any other error where parser can produce a valid AST.
ee3aae5 to
773d34d
Compare
20b5b7c to
7b28b6f
Compare

ESLint's has many test cases with invalid code. Loosen parsing in conformance test, so parsing only errors if there's a fatal error, and allow any other error where parser can produce a valid AST.