mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 20:28:58 +00:00
refactor(linter/oxc): improve code comment for no-accumulating-spread (#5373)
mentioned here: https://github.com/oxc-project/oxc/pull/5302#discussion_r1735759462 it's not exactly clear why we check that it's a `let` declaration kind.
This commit is contained in:
parent
db554447aa
commit
024b58506e
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue