no-param-reassign
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"no-param-reassign": "error",
},
},
];const foo = function(bar) {
bar = 13;
}
const foo1 = function(bar) {
bar++;
}
const foo2 = function(bar) {
for (bar in baz) {}
}
const foo3 = function(bar) {
for (bar of baz) {}
}const foo = function(bar) {
const baz = bar;
}Examples from the ESLint documentation.
no-param-reassign
eslint
export default [
{
rules: {
"no-param-reassign": "error",
},
},
];no-param-reassign
eslint plugin · restriction
{
"rules": {
"no-param-reassign": "error"
}
}style/noParameterAssign
style · since 1.0.0
{
"linter": {
"rules": {
"style": {
"noParameterAssign": "error"
}
}
}
}Disallow the unary operators ++ and --
Require or disallow named function expressions
Enforce that class methods utilize this
Require default cases in switch statements
Require destructuring from arrays and/or objects
Enforce default parameters to be last