Skip to content
PluginStats

eslint-plugin-better-mutation weekly downloads statistics

By sloops77 · npm · ESLint plugins

ESLint rules for controlling where and how mutation is used.

View on npm Fresh · Oct 18, 2026

eslint-plugin-better-mutation has 20,484 recorded weekly downloads on npm, a decrease of 47.5% over the past 30 days, ranking #787 of 2,322 tracked listings.

Weekly downloads
20,484
Official API · Oct 18, 2026
7-day growth
-54.7%
-24.7K weekly downloads
30-day growth
-47.5%
-18.5K weekly downloads
90-day growth
-45.5%
-17.1K weekly downloads
Rank
#787
Among tracked npm listings

About eslint-plugin-better-mutation

eslint-plugin-better-mutation

CI codecov XO code style

ESLint rules so you and your team use immutable values when you should, and permits mutation when it's safe.

Preventing unsafe mutation of shared variables prevents a huge class of bugs from ever appearing.

The plugin's goal is to prevent modification of shared variables, such as function parameters or globals whether via assignment, operators, functions or methods.

Locally declared variables are permitted to use mutation, because in most circumstances this is safe.

See WHY.

What's not safe?

Mutating variables of shared variables is unsafe. This means reassignment outside of the scope they are declared within whether its because they are globals, function parameters, or closed over variables can lead to undefined behaviour that is hard to debug and can cause race conditions. Instead of mutating always return a new value.

g = 2 // global reassignment is unsafe

function foo(i) {
   i += 1 // don't resassign function parameters
}

let a = 1; 
function bar() { 
   a = 2; // don't reassign closed over vars
}

What's safe?

Block scoped (let) or function scoped variables (var) can be reassigned safely.

function foo() {
  let i = 1; 
  i = 2;
}

Even objects or arrays marked with const can have nested properties changed within the block scope they belong to. The same rules apply for mutating functions (e.g. Object.assign() and mutating methods [].push()

function foo() {
  const o = { a: 0 };
  o.a += 1;
}

Common js uses assignment and is supported via a special case

module.exports = { foo }; // by default commonjs exports are configured to be safe

Variables created using constructors such as the Array constructor are safe to modify. However the Object constructor is not safe because it returns the reference if its an object)

const myObject = new MyObject();
myObject.foo = 'bar'

const array = new Array(1, 2, 3);
array[2] += 1;

const o = new Object({1,2});
o.foo = 'bar' // error

Variables created using static initializers such as the Array constructor, Array.from or Array.of are also safe to modify.

const array = Array.of(1,2,3)
array[2] += 1;

Similarly for Objects there are a few static initializers that are safe.

const o = Object.create({1,2,3})
o.foo = 'bar' // safe

Changing an array created using an instance method such as map is not permitted. Most JS developers would never do this! If you would like it track the open issue at https://github.com/sloops77/eslint-plugin-better-mutation/issues

const x = array.map(i => i + 1);
x[2] += 1;  // error

Reducer functions/methods are a special case and may modify the accumulator parameter because the loop that the reducer executes limits the scope of the accumulator to the reducer function.

function sum(numbers) {
  return numbers.reduce((acc, val) => {
    acc += val;  // this is safe!
    return acc;    
  }, 0);
}

Install

$ npm install --save-dev eslint eslint-plugin-better-mutation

Usage

For flat config (Eslint 8.x and above)

In a js file

// eslint.config.mjs
import pluginBetterMutation from "eslint-plugin-better-mutation";

export default [
  // ...
  {
    name: "my-awesome-project",
    plugins: {
      "better-mutation": pluginBetterMutation,
    },
    extends: ["better-mutation/recommended"]
  },
]; 
For classic config (Eslint 8.x and below)
<!-- EXAMPLE_CONFIGURATION:START -->

Configure it in .eslintrc or package.json.

{
  "plugins": [
    "better-mutation"
  ],
  "extends": "plugin:better-mutation/recommended"
}
<!-- EXAMPLE_CONFIGURATION:END -->

Advanced configuration

Advanced configuration enables setting individual rule configuration.

export default {
  // ... other config
  plugins: {
    "better-mutation": pluginBetterMutation,
  },
  "rules": {
    "better-mutation/no-mutating-functions": "error",
    "better-mutation/no-mutating-methods": "error",
    "better-mutation/no-mutation": "error"
    // ... other rules
  }
}
Rules
<!-- RULES:START --> <!-- RULES:END -->

Currently unsupported

  • lodash fp

See ESLint documentation for more information about extending configuration files.

MIT © Andres Olave

Thanks to Jeroen Engels for providing the basis of this plugin. Checkout https://github.com/jfmengels/eslint-plugin-fp for a strict functional programming approach.

Description from the npm listing.

  • eslint
  • plugin
  • eslint-plugin
  • eslintplugin
  • fp
  • FP
  • function
  • functional
  • programming
  • lodash
  • mutation
  • immutable
  • functions
  • method
  • methods

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

eslint-plugin-better-mutation weekly downloads on npm, last 90 days: 20,484 weekly downloads as of Oct 18, 2026, -45.5% over 90 days.eslint-plugin-better-mutationWeekly downloads on npm · Last 90 days20,484downloads / week-45.5% over 90 days020K40K60K80KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
eslint-plugin-better-mutation weekly downloads on npm, last 90 days: 20,484 weekly downloads as of Oct 18, 2026, -45.5% over 90 days.

7/30/90-day growth

eslint-plugin-better-mutation weekly downloads growth on npm: -54.7% over 7 days, -47.5% over 30 days, -45.5% over 90 days.eslint-plugin-better-mutationWeekly downloads growth on npm20,484downloads / week now7-day growth-24,729 weekly downloads-54.7%30-day growth-18,521 weekly downloads-47.5%90-day growth-17,081 weekly downloads-45.5%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
eslint-plugin-better-mutation weekly downloads growth on npm: -54.7% over 7 days, -47.5% over 30 days, -45.5% over 90 days.

Ranking history

eslint-plugin-better-mutation npm ranking history: currently #787 (by weekly downloads).eslint-plugin-better-mutationnpm ranking · by weekly downloads · Last 90 days#787current rank#710#720#730#740#750#760#770#780#790Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 18, 2026 – Oct 20, 2026 · 3 observations · Updated Oct 18, 2026pluginstats.com
eslint-plugin-better-mutation npm ranking history: currently #787 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,162 shown · page 40, #8 (overall #788)
All npm: every listing in weekly downloads order

Listing placement

ESLint plugins256 listings · 13 pages · page 10, #9 (overall #189)
ESLint plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (122)
Recent weekly downloads observations for eslint-plugin-better-mutation
Date (UTC)Weekly downloadsChange vs. previous
20,484-2.3K
22,800-1.4K
24,187+584
23,603-10.1K
33,680-10.3K
43,9800
43,980-1.2K
45,213+2.5K
42,709+584
42,125-4.8K
46,950-3.5K
50,451-7.9K
58,375-15.9K
74,259—

Similar npm ESLint plugins plugins

All 20 eslint-plugin-better-mutation alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/eslint-plugin-better-mutation. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.