Skip to content

Commit 4af7f8d

Browse files
committed
use ancestors.skip(1)
1 parent f64bfa2 commit 4af7f8d

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

crates/biome_js_analyze/src/lint/nursery/no_parameters_only_used_in_recursion.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,7 @@ fn get_arrow_function_name(
317317
let arrow_syntax = arrow_fn.syntax();
318318

319319
// Walk up the syntax tree to find a variable declarator or assignment
320-
for ancestor in arrow_syntax.ancestors() {
321-
// Skip the arrow function node itself
322-
if ancestor == *arrow_syntax {
323-
continue;
324-
}
325-
320+
for ancestor in arrow_syntax.ancestors().skip(1) {
326321
// Check for variable declarator: const foo = () => ...
327322
if let Some(declarator) = JsVariableDeclarator::cast_ref(&ancestor) {
328323
return declarator

0 commit comments

Comments
 (0)