@exodus/eslint-plugin-mutable
v2.0.1
Published
ESLint rules for mutating
Downloads
11,550
Maintainers
Keywords
Readme
@exodus/eslint-plugin-mutable
Lints your code for modifying function arguments.
function BadCode(someObject) {
someObject.bad = 'do not mutate objects passed by reference'
}
Installation
yarn add --dev @exodus/eslint-plugin-mutable
// eslintrc.js
module.exports = {
plugins: ['@exodus/eslint-plugin-mutable'],
...
}
Usage
// eslintrc.js
module.exports = {
...
plugins: ['@exodus/eslint-plugin-mutable'],
rules: {
'@exodus/mutable/no-param-reassign-prop-only': 'error',
},
}
Supported Rules
@exodus/mutable/no-param-reassign-prop-only
- Detects and reports assignment and modification of objects passed as argument to a function
Full Example
// eslintrc.js
module.exports = {
...
plugins: ['@exodus/eslint-plugin-mutable'],
rules: {
'@exodus/mutable/no-param-reassign-prop-only': 'error',
},
}