From 63fc953de4f5e57a91734d401a0206c3ac89cb53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michell=20Oca=C3=B1a?= Date: Tue, 28 May 2024 11:24:36 -0300 Subject: [PATCH] feat(lint/noLabelWithoutControl): fix lint issue --- .../src/lint/nursery/no_label_without_control.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/biome_js_analyze/src/lint/nursery/no_label_without_control.rs b/crates/biome_js_analyze/src/lint/nursery/no_label_without_control.rs index c3ec72f1c197..0269052fbf92 100644 --- a/crates/biome_js_analyze/src/lint/nursery/no_label_without_control.rs +++ b/crates/biome_js_analyze/src/lint/nursery/no_label_without_control.rs @@ -255,7 +255,7 @@ fn has_accessible_label( let has_label_attribute = label_attributes.contains(&attribute_name) || default_label_attributes.contains(&attribute_name.as_str()); let is_aria_labelledby_attribute = jsx_name.text() == "aria-labelledby"; - let has_value = has_jsx_attribute_value(jsx_attribute_value); + let has_value = has_jsx_attribute_value(&jsx_attribute_value); if has_value && (is_aria_labelledby_attribute || has_label_attribute) { has_accessible_attribute = true @@ -272,7 +272,7 @@ fn has_accessible_label( } /// Returns whether the passed `jsx_attribute_value` has a valid value inside it -fn has_jsx_attribute_value(jsx_attribute_value: AnyJsxAttributeValue) -> bool { +fn has_jsx_attribute_value(jsx_attribute_value: &AnyJsxAttributeValue) -> bool { jsx_attribute_value .as_static_value() .is_some_and(|static_value| !static_value.text().trim().is_empty())