no-for-in-array
Configuration
rslint.config.ts
Rule Details
Disallows iterating over arrays with a for-in loop. Using for-in on arrays is problematic because it skips holes, returns indices as strings rather than numbers, and may visit inherited enumerable properties from the prototype chain. Use for-of, Array.prototype.forEach, or a standard for loop instead.
Examples of incorrect code for this rule:
Examples of correct code for this rule: