eslint-plugin-no-param-reassign-allow-reduce

v1.0.1
A copy of the 'no-param-reassign' rule but with allowances made for array.reduce
eslint eslint-plugin

eslint-plugin-no-param-reassign-allow-reduce

The rule no-param-reassign is a worthwhile rule to enable but array.reduce() requires you to break this rule. Use this rule instead which allows you to enable the rule but does not throw errors when you do this within the contex of the array.reduce function.

npm Package

Installation

$ npm i eslint-plugin-no-param-reassign-allow-reduce

Usage

Add no-param-reassign-allow-reduce to the plugins section of your .eslintrc configuration file and add the rules to the rule section.

{
  "plugins": ["no-param-reassign-allow-reduce"]
}

...

{
  "rules": {
    "no-param-reassign-allow-reduce/allow-reduce": 2,
    "no-param-reassign-allow-reduce/no-reduce-identifiers": 2
  }
}

Metadata

  • MIT
  • Whatever
  • Joe Davis
  • released 1/23/2018

Downloads

Maintainers