---
source: crates/oxc_linter/src/tester.rs
---
  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduce((str, item) => str += item, "")
   ·       ──────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:2:10]
 1 │ 
 2 │             array.reduce((obj, item) => {
   ·                   ──────
 3 │                 obj[item] = null;
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduce((obj, item) => ({ [item]: null }), {})
   ·       ──────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:3:20]
 2 │             const hyphenate = (str, char) => `${str}-${char}`;
 3 │             ["a", "b", "c"].reduce(hyphenate);
   ·                             ──────
 4 │             
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:11]
 1 │ [].reduce.call(array, (s, i) => s + i)
   ·           ────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:11]
 1 │ [].reduce.call(array, sum);
   ·           ────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:11]
 1 │ [].reduce.call(sum);
   ·           ────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:24]
 1 │ Array.prototype.reduce.call(array, (s, i) => s + i)
   ·                        ────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:24]
 1 │ Array.prototype.reduce.call(array, sum);
   ·                        ────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:11]
 1 │ [].reduce.apply(array, [(s, i) => s + i])
   ·           ─────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:11]
 1 │ [].reduce.apply(array, [sum]);
   ·           ─────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:24]
 1 │ Array.prototype.reduce.apply(array, [(s, i) => s + i])
   ·                        ─────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:24]
 1 │ Array.prototype.reduce.apply(array, [sum]);
   ·                        ─────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:2:10]
 1 │ 
 2 │             array.reduce((total, item) => {
   ·                   ──────
 3 │                 return total + doComplicatedThings(item);
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduce((total, item) => total + item)
   ·       ──────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduce((total, item) => { return total - item })
   ·       ──────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduce(function (total, item) { return total * item })
   ·       ──────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduce((total, item) => total + item, 0)
   ·       ──────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduce((total, item) => { return total - item }, 0 )
   ·       ──────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduce(function (total, item) { return total * item }, 0)
   ·       ──────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:2:11]
 1 │ 
 2 │                 array.reduce((total, item) => {
   ·                       ──────
 3 │                     return (total / item) * 100;
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduceRight((str, item) => str += item, "")
   ·       ───────────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:2:10]
 1 │ 
 2 │             array.reduceRight((obj, item) => {
   ·                   ───────────
 3 │                 obj[item] = null;
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduceRight((obj, item) => ({ [item]: null }), {})
   ·       ───────────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:3:20]
 2 │             const hyphenate = (str, char) => `${str}-${char}`;
 3 │             ["a", "b", "c"].reduceRight(hyphenate);
   ·                             ───────────
 4 │             
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:16]
 1 │ [].reduceRight.call(array, (s, i) => s + i)
   ·                ────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:16]
 1 │ [].reduceRight.call(array, sum);
   ·                ────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:16]
 1 │ [].reduceRight.call(sum);
   ·                ────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:29]
 1 │ Array.prototype.reduceRight.call(array, (s, i) => s + i)
   ·                             ────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:29]
 1 │ Array.prototype.reduceRight.call(array, sum);
   ·                             ────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:16]
 1 │ [].reduceRight.apply(array, [(s, i) => s + i])
   ·                ─────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:16]
 1 │ [].reduceRight.apply(array, [sum]);
   ·                ─────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:29]
 1 │ Array.prototype.reduceRight.apply(array, [(s, i) => s + i])
   ·                             ─────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:29]
 1 │ Array.prototype.reduceRight.apply(array, [sum]);
   ·                             ─────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:2:10]
 1 │ 
 2 │             array.reduceRight((total, item) => {
   ·                   ───────────
 3 │                 return total + doComplicatedThings(item);
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduceRight((total, item) => total + item)
   ·       ───────────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduceRight((total, item) => { return total - item })
   ·       ───────────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduceRight(function (total, item) { return total * item })
   ·       ───────────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduceRight((total, item) => total + item, 0)
   ·       ───────────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduceRight((total, item) => { return total - item }, 0 )
   ·       ───────────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:1:7]
 1 │ array.reduceRight(function (total, item) { return total * item }, 0)
   ·       ───────────
   ╰────
  help: Refactor your code to use `for` loops instead.

  ⚠ eslint-plugin-unicorn(no-array-reduce): Don't use `Array#reduce()` and `Array#reduceRight()`, use `for` loops instead.
   ╭─[no_array_reduce.tsx:2:11]
 1 │ 
 2 │                 array.reduceRight((total, item) => {
   ·                       ───────────
 3 │                     return (total / item) * 100;
   ╰────
  help: Refactor your code to use `for` loops instead.
