Skip to content

Commit 9a8fe0f

Browse files
ematipicodyc3
andauthored
fix(linter): don't enable nursery rules in domains (#6503)
Co-authored-by: dyc3 <[email protected]>
1 parent 09f49ba commit 9a8fe0f

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

.changeset/khaki-paths-cry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@biomejs/biome": patch
3+
---
4+
5+
Fixed [#6482](https://github.com/biomejs/biome/issues/6482) where nursery rules that belonged to a domain were incorrectly enabled.

crates/biome_service/src/file_handlers/mod.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,12 @@ impl<'a, 'b> LintVisitor<'a, 'b> {
10111011
L: biome_rowan::Language,
10121012
R: Rule<Query: Queryable<Language = L, Output: Clone>> + 'static,
10131013
{
1014+
let group = <R::Group as RuleGroup>::NAME;
1015+
// Nursery rules must be enabled only when they are enabled from the group
1016+
if group == "nursery" {
1017+
return;
1018+
}
1019+
10141020
let path = self.path.expect("File path");
10151021

10161022
let recommended_enabled = self
@@ -1057,7 +1063,11 @@ impl<'a, 'b> LintVisitor<'a, 'b> {
10571063
R: Rule<Query: Queryable<Language = L, Output: Clone>> + 'static,
10581064
{
10591065
let no_only = self.only.is_some_and(|only| only.is_empty());
1060-
1066+
let group = <R::Group as RuleGroup>::NAME;
1067+
// Nursery rules must be enabled only when they are enabled from the group
1068+
if group == "nursery" {
1069+
return;
1070+
}
10611071
if !no_only {
10621072
return;
10631073
}

0 commit comments

Comments
 (0)