Skip to content

ESLint plugin to guard against unexpected mutations of objects in javascript

Notifications You must be signed in to change notification settings

peterkhayes/eslint-plugin-mutation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

eslint-plugin-mutation

Checks for mutations of objects. Allows a whitelist of mutable objects.

Getting started

Installation

npm i --save-dev eslint-plugin-mutation

Usage

Add the following to your .eslintrc

By default, "this" and "global" are allowed to be mutated.

  plugins: [
    "mutation"
  ],
  rules: {
    "mutation/no-mutation": 2
  }

This can be customized.

  plugins: [
    "mutation"
  ],
  rules: {
    "mutation/no-mutation": [2, {exceptions: ["this", "that", "global", "window"]}]
  }

Contributing

Please submit a PR.

About

ESLint plugin to guard against unexpected mutations of objects in javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published