
Security News
VulnCon 2025: NVD Scraps Industry Consortium Plan, Raising Questions About Reform
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
eslint-plugin-no-array-reduce
Advanced tools
ESLint rule to disallow Array.reduce()
method.
Method reduce()
in most cases can be written as map()
, filter()
or one of the for()
loops which benefits in code readability and makes it easier to maintain for future developers.
There are many debates, discussions and other resources related to it:
npm install --save-dev eslint-plugin-no-array-reduce
Then extend eslint config:
{
"extends": [
// ...
"plugin:no-array-reduce/recommended"
]
}
const groceries = [
{ name: 'milk', type: 'dairy' },
{ name: 'cheese', type: 'dairy' },
{ name: 'beef', type: 'meat' },
];
// Filter dairy products
const dairy = groceries.reduce((acc, grocery) => (grocery.type === 'dairy' ? acc.concat(grocery) : acc), []);
// Filter dairy products
const dairy = groceries.filter((grocery) => grocery.type === 'dairy');
Subjectively there are cases where you still might want to use reduce()
with eslint-disable
.
All contributions are welcome!
FAQs
ESLint rule to disallow Array.reduce() method.
The npm package eslint-plugin-no-array-reduce receives a total of 2,220 weekly downloads. As such, eslint-plugin-no-array-reduce popularity was classified as popular.
We found that eslint-plugin-no-array-reduce demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.
Product
Our redesigned Repositories page adds alert severity, filtering, and tabs for faster triage and clearer insights across all your projects.