diff --git a/crates/oxc_linter/src/rules/oxc/only_used_in_recursion.rs b/crates/oxc_linter/src/rules/oxc/only_used_in_recursion.rs index c4a2dd558fa1a3..dd525d9867495c 100644 --- a/crates/oxc_linter/src/rules/oxc/only_used_in_recursion.rs +++ b/crates/oxc_linter/src/rules/oxc/only_used_in_recursion.rs @@ -304,6 +304,7 @@ fn is_argument_only_used_in_recursion<'a>( .semantic() .symbol_references(arg.symbol_id.get().expect("`symbol_id` should be set")) .peekable(); + // Avoid returning true for an empty iterator if references.peek().is_none() { return false;