diff --git a/crates/oxc_linter/src/rules/oxc/no_accumulating_spread.rs b/crates/oxc_linter/src/rules/oxc/no_accumulating_spread.rs index 525e4a7831774..b2cbcdcf9a052 100644 --- a/crates/oxc_linter/src/rules/oxc/no_accumulating_spread.rs +++ b/crates/oxc_linter/src/rules/oxc/no_accumulating_spread.rs @@ -185,7 +185,8 @@ fn check_loop_usage<'a>( let AstKind::VariableDeclaration(declaration) = declaration_node.kind() else { return; }; - + // if the accumulator's declaration is not a `let`, then we know it's never + // reassigned, hence cannot be a violation of the rule if !matches!(declaration.kind, VariableDeclarationKind::Let) { return; }