diff --git a/crates/biome_css_analyze/src/lint/nursery/no_unknown_unit.rs b/crates/biome_css_analyze/src/lint/nursery/no_unknown_unit.rs index b3507d829eb9..01858a7a7eee 100644 --- a/crates/biome_css_analyze/src/lint/nursery/no_unknown_unit.rs +++ b/crates/biome_css_analyze/src/lint/nursery/no_unknown_unit.rs @@ -70,14 +70,14 @@ declare_rule! { } } -pub struct RuleState { - value: String, +pub struct NoUnknownUnitState { + unit: String, span: TextRange, } impl Rule for NoUnknownUnit { type Query = Ast; - type State = RuleState; + type State = NoUnknownUnitState; type Signals = Option; type Options = (); @@ -93,8 +93,8 @@ impl Rule for NoUnknownUnit { return None; } - Some(RuleState { - value: unit, + Some(NoUnknownUnitState { + unit, span: unit_token.text_trimmed_range(), }) } @@ -158,8 +158,8 @@ impl Rule for NoUnknownUnit { } if !allow_x { - return Some(RuleState { - value: unit, + return Some(NoUnknownUnitState { + unit, span: unit_token.text_trimmed_range(), }); } @@ -172,13 +172,12 @@ impl Rule for NoUnknownUnit { } fn diagnostic(_: &RuleContext, state: &Self::State) -> Option { - let span = state.span; Some( RuleDiagnostic::new( rule_category!(), - span, + state.span, markup! { - "Unexpected unknown unit: "{ state.value } + "Unexpected unknown unit: "{ state.unit } }, ) .note(markup! {