This rule enforces the following:
forloop iterator variables should be named
i. Nested loops should use the variables
k, and so on.
forloops. By default, this limit is three.
forloop updates. The prefix version of these operators should be used instead.
var i = 0;is allowed in the initialization section. This only applies to variable declarations, not assignments to existing variables. This means that
for (i = 0, j = 0)is allowed if
jare existing variables. Variable declarations involving destructuring are not allowed.
This rule can be configured by providing a single options object. The object supports the following keys.
A number representing the maximum allowed nesting of
for loops. Defaults to three.
The first variable iterator name to use. This defaults to