Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sindresorhus/eslint-plugin-unicorn/llms.txt
Use this file to discover all available pages before exploring further.
Array#reduce() and Array#reduceRight() typically produce hard-to-read and less performant code. In almost every case, they can be replaced by .map(), .filter(), or a for…of loop, which are easier to follow and debug.
| Recommended | ✅ recommended |
| Fixable | — |
| Suggestions | — |
Examples
Configuration
eslint.config.js
allowSimpleOperations
Type: boolean — Default: true
When true (the default), reduce calls whose callback body is a single binary expression are allowed. This covers the common case of summing numbers or concatenating strings.
false to ban reduce entirely: