Skip to content

fix(linter/plugins): RuleTester sort diagnostics before comparing to errors#16741

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

fix(linter/plugins): RuleTester sort diagnostics before comparing to errors#16741
graphite-app[bot] merged 1 commit intomainfrom
12-11-fix_linter_plugins_ruletester_sort_diagnostics_before_comparing_to_errors

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Dec 11, 2025

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.

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 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 assertInvalidTestCasePasses before 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.

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
Copy link
Copy Markdown
Member Author

overlookmotel commented Dec 11, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 12-11-test_linter_plugins_conformance_tester_add_summary_of_failing_tests_to_report branch from 4baa91e to 71632c6 Compare December 11, 2025 11:25
@graphite-app graphite-app bot force-pushed the 12-11-fix_linter_plugins_ruletester_sort_diagnostics_before_comparing_to_errors branch from d87c7ee to d98462b Compare December 11, 2025 11:25
@overlookmotel overlookmotel force-pushed the 12-11-fix_linter_plugins_ruletester_sort_diagnostics_before_comparing_to_errors branch from d98462b to a9e4221 Compare December 11, 2025 11:48
@overlookmotel overlookmotel force-pushed the 12-11-test_linter_plugins_conformance_tester_add_summary_of_failing_tests_to_report branch from 71632c6 to 339b30a Compare December 11, 2025 11:48
…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.
@graphite-app graphite-app bot force-pushed the 12-11-test_linter_plugins_conformance_tester_add_summary_of_failing_tests_to_report branch from 339b30a to 9a964da Compare December 11, 2025 11:50
@graphite-app graphite-app bot force-pushed the 12-11-fix_linter_plugins_ruletester_sort_diagnostics_before_comparing_to_errors branch from a9e4221 to 36c9097 Compare December 11, 2025 11:51
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
Base automatically changed from 12-11-test_linter_plugins_conformance_tester_add_summary_of_failing_tests_to_report to main December 11, 2025 11:57
@graphite-app graphite-app bot merged commit 36c9097 into main Dec 11, 2025
19 checks passed
@graphite-app graphite-app bot deleted the 12-11-fix_linter_plugins_ruletester_sort_diagnostics_before_comparing_to_errors branch December 11, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants