Commit 26288ff2 authored by Antoine du Hamel's avatar Antoine du Hamel
Browse files

tools: add ESLint rule no-array-destructuring

Iterating over arrays should be avoided because it relies on
user-mutable global methods (`Array.prototype[Symbol.iterator]`
and `%ArrayIteratorPrototype%.next`), we should instead use
other alternatives. This commit adds a rule that disallow
array destructuring syntax in favor of object destructuring syntax.
Note that you can ignore this rule if you are using
the array destructuring syntax over a safe iterable, or
actually want to iterate over a user-provided object.

PR-URL: https://github.com/nodejs/node/pull/36818


Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
parent f34d8de6
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment