Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(service): sort diagnostics by severity in descending order #5534

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

karpawich
Copy link

Summary

If Biome is to enforce a limit on the number of diagnostics shown to the user, then it ought to sort them so as to show the most severe diagnostics first.

See Discussion#5180

Test Plan

I implemented a simple test of the sorting logic in scanner.tests.ts

@github-actions github-actions bot added the A-Project Area: project label Apr 1, 2025
@karpawich
Copy link
Author

To whom it may concern: I'm rusty with Rust. Please refactor as you see fit!

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution.

There's one more place where diagnostics are collected. It's in the CLI: https://github.com/biomejs/biome/blob/main/crates%2Fbiome_cli%2Fsrc%2Fexecute%2Ftraverse.rs#L140-L154

@ematipico
Copy link
Member

Also, remember to add a changeset too. It's explained in the contribution guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Project Area: project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants