diff --git a/crates/biome_js_analyze/src/lint/nursery/no_useless_undefined.rs b/crates/biome_js_analyze/src/lint/nursery/no_useless_undefined.rs index 9c4c01d58f1f..e1a68fcdab1c 100644 --- a/crates/biome_js_analyze/src/lint/nursery/no_useless_undefined.rs +++ b/crates/biome_js_analyze/src/lint/nursery/no_useless_undefined.rs @@ -237,7 +237,7 @@ impl Rule for NoUselessUndefined { "Don't use unnecessary ""undefined""." }, ) - .note(markup! { + .note(markup! { """undefined"" is the default value for new variables, parameters, return statements, etc… so specifying it doesn't make any difference." }), ) @@ -258,7 +258,8 @@ impl Rule for NoUselessUndefined { .filter_map(Result::ok) .find(|decl| { decl.id().is_ok_and(|id| { - id.text() == state.binding_text.as_deref().unwrap_or("") + id.syntax().text_trimmed() + == state.binding_text.as_deref().unwrap_or("") }) })?; diff --git a/crates/biome_js_analyze/src/lint/nursery/use_collapsed_if.rs b/crates/biome_js_analyze/src/lint/nursery/use_collapsed_if.rs index f5707629c673..c9a2291babd6 100644 --- a/crates/biome_js_analyze/src/lint/nursery/use_collapsed_if.rs +++ b/crates/biome_js_analyze/src/lint/nursery/use_collapsed_if.rs @@ -1,7 +1,4 @@ -use biome_analyze::{ - context::RuleContext, declare_lint_rule, ActionCategory, Ast, FixKind, Rule, RuleDiagnostic, - RuleSource, -}; +use biome_analyze::{context::RuleContext, declare_lint_rule, ActionCategory, Ast, FixKind, QueryMatch, Rule, RuleDiagnostic, RuleSource}; use biome_console::markup; use biome_js_factory::make; use biome_js_syntax::parentheses::NeedsParentheses;