fix(linter/plugins): RuleTester sort diagnostics before comparing to errors#16741
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 fixes non-deterministic test failures in the conformance tester by ensuring diagnostics are sorted by line and column before comparison with expected errors. This matches ESLint's RuleTester behavior and eliminates ordering-dependent test failures.
Key Changes:
- Added sorting of diagnostics by line then column in
assertInvalidTestCasePassesbefore comparing to expected errors - Updated conformance snapshot showing 86 additional tests now passing across 11 rules that previously had ordering-related failures
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/oxlint/src-js/package/rule_tester.ts | Added diagnostic sorting by line and column before comparison to expected errors, matching ESLint's behavior |
| apps/oxlint/conformance/snapshot.md | Updated test results showing 11 rules moved from partially passing to fully passing (86 additional tests passing) due to proper diagnostic ordering |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
4baa91e to
71632c6
Compare
d87c7ee to
d98462b
Compare
d98462b to
a9e4221
Compare
71632c6 to
339b30a
Compare
…o errors (#16741) `RuleTester` sort diagnostics in source order before comparing to expected errors. This follows what ESLint does (and it makes sense). Conformance tests now fully passing for 11 more rules.
339b30a to
9a964da
Compare
a9e4221 to
36c9097
Compare

RuleTestersort diagnostics in source order before comparing to expected errors. This follows what ESLint does (and it makes sense).Conformance tests now fully passing for 11 more rules.