prefer-for-of Prefer for-of when a loop only indexes one array A complete index loop whose counter only selects array elements maintains an index it never uses directly. Instead, you SHOULD iterate over the array values with a for-of loop. - Category: style - Level: warning - Fix: none - Scope: module Reported function copy(values: int32[], output: int32[]): void { for (let index: isize = 0; index < values.length; index++) { output.push(values[index]); } } Accepted function copy(values: int32[], output: int32[]): void { for (const value of values) { output.push(value); } } Prior art - typescript-eslint ยท prefer-for-of language/linter/src/rules/style/preferforof.rs:7