Skip to content

Commit

Permalink
fix(analyze): improve diagnostic message for unused suppression comme…
Browse files Browse the repository at this point in the history
…nts (#4200)
  • Loading branch information
dyc3 authored Oct 7, 2024
1 parent d04ab5b commit 055b0db
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b

### Analyzer

#### Bug fixes

- Improved the message for unused suppression comments. Contributed by @dyc3

### CLI

### Configuration
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_analyze/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ where
SuppressionDiagnostic::new(
category!("suppressions/unused"),
suppression.comment_span,
"Suppression comment is not being used",
"Suppression comment has no effect. Remove the suppression or make sure you are suppressing the correct rule.",
)
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ SuppressionComments.js:11:5 suppressions/deprecatedSuppressionComment FIXABLE
```
SuppressionComments.js:1:1 suppressions/unused ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Suppression comment is not being used
! Suppression comment has no effect. Remove the suppression or make sure you are suppressing the correct rule.
> 1 │ // rome-ignore lint/correctness/noUnreachable: this comment does nothing
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ ignoredDependencies.js:8:5 lint/correctness/useExhaustiveDependencies ━━━
```
ignoredDependencies.js:16:5 suppressions/unused ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Suppression comment is not being used
! Suppression comment has no effect. Remove the suppression or make sure you are suppressing the correct rule.
14 │ function IgnoredDependencies2() {
15 │ let a = 1;
Expand Down

0 comments on commit 055b0db

Please sign in to comment.