Registry /
testing / eslint-plugin-no-array-reduce
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
plugin
✓ // In .eslintrc: { "plugins": ["no-array-reduce"] }
✗ const plugin = require('eslint-plugin-no-array-reduce')
The plugin is loaded via ESLint config, not imported directly in code.
recommended config
✓ // In .eslintrc: { "extends": ["plugin:no-array-reduce/recommended"] }
✗ // No common wrong import; ensure correct plugin name in 'extends'.
Use the recommended config to enable the rule. You can also manually configure the rule under 'rules'.
rule itself
✓ // In .eslintrc: { "rules": { "no-array-reduce/no-reduce": "error" } }
✗ // Using rule name without prefix: { "rules": { "no-reduce": "error" } }
The rule is namespaced under the plugin prefix 'no-array-reduce/' to avoid conflicts.
Shows installation, ESLint configuration, a failing use of reduce(), and how to disable the rule inline.
// Install the plugin
npm install --save-dev eslint-plugin-no-array-reduce
// Add to .eslintrc.json:
{
"plugins": ["no-array-reduce"],
"extends": ["plugin:no-array-reduce/recommended"]
}
// Example file that will fail linting:
const arr = [1, 2, 3];
const sum = arr.reduce((acc, x) => acc + x, 0);
// Example file that passes:
const sum = arr.reduce((acc, x) => acc + x, 0); // eslint-disable-line no-array-reduce/no-reduce
Errors
Common errors & fixes
ESLint: Failed to load plugin 'no-array-reduce': Cannot find module 'eslint-plugin-no-array-reduce'
The plugin is not installed or not in node_modules.
fixRun npm install --save-dev eslint-plugin-no-array-reduce
ESLint: Configuration for rule 'no-reduce' is invalid. Rule 'no-reduce' not found.
Using the rule name without the plugin prefix.
fixUse 'no-array-reduce/no-reduce' as the rule name.
TypeError: Cannot read property 'some' of undefined (when using TypeScript parser)
The plugin expects ESLint >=7.0.0 and may have issues with older versions or custom parsers.
fixEnsure ESLint version is 7.0.0 or higher.
Audit
Dependencies
eslintrequiredPeer dependency required to load the plugin. Must be >=7.0.0.