no-reduce-accumulator-copy
Review copies of the accumulated collection inside a built-in reduce callback.
Why
Copying a growing accumulator at every step can make collection quadratic instead of linear in its output size.
Fix
Use map or flatMap where their semantics match, or append into a fresh locally owned accumulator. Preserve retained snapshots and shared state.
Examples
declare const pages: string[][];const rows = pages.reduce<string[]>((acc, page) => acc.concat(page), []);declare const pages: string[][];const rows = pages.flatMap((page) => page);