You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
β― cat biome.json
{
"assist": {
"actions": {
"source": {
"useSortedKeys": "on"
}
}
}
}
β― cat file.js
// biome-ignore assist/source/useSortedKeys: tst
var foo = {
lorem: "lorem", // the text range starts at this line, which is missed by the suppression comment
ipsum: "ipsum",
};
β― biome check file.js
/file.js:1:1 suppressions/unused ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Suppression comment has no effect. Remove the suppression or make sure you are suppressing the correct rule.
> 1 β // biome-ignore assist/source/useSortedKeys: tst
β ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 β var foo = {
3 β lorem: "lorem", // the text range starts at this line, which is missed by the suppression comment
Expected result
The suppression comment should not be considered as useless.
The issue also affect other assist actions.
Code of Conduct
I agree to follow Biome's Code of Conduct
The text was updated successfully, but these errors were encountered:
Investigating this, and it seems that the issue comes down to the fact that in that particular code, there are two signals coming from the same line:
source/useSortedKeys
suspicious/noVar
The suppression system isn't aware (yet) of the distinction between lint rules and assist actions. When running the check command (or even lint), we hit a false positive where suspicious/noVar is suppressed by another suppression comment.
In fact, if you run check --linter-enabled=false won't yield any errors.
Environment information
What happened?
Here a reproduction:
β― cat biome.json { "assist": { "actions": { "source": { "useSortedKeys": "on" } } } } β― cat file.js // biome-ignore assist/source/useSortedKeys: tst var foo = { lorem: "lorem", // the text range starts at this line, which is missed by the suppression comment ipsum: "ipsum", }; β― biome check file.js /file.js:1:1 suppressions/unused ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β Suppression comment has no effect. Remove the suppression or make sure you are suppressing the correct rule. > 1 β // biome-ignore assist/source/useSortedKeys: tst β ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 β var foo = { 3 β lorem: "lorem", // the text range starts at this line, which is missed by the suppression comment
Expected result
The suppression comment should not be considered as useless.
The issue also affect other assist actions.
Code of Conduct
The text was updated successfully, but these errors were encountered: