Skip to content

Commit

Permalink
refactor(linter/oxc): improve code comment for no-accumulating-spread
Browse files Browse the repository at this point in the history
  • Loading branch information
camc314 committed Aug 31, 2024
1 parent 11b93af commit c9a59e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/oxc_linter/src/rules/oxc/no_accumulating_spread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c9a59e3

Please sign in to comment.