sonarjs/no-parameter-reassignment
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-parameter-reassignment": "error",
},
},
];Initial values of parameters, caught exceptions, and loop variables should not be ignored
function MyClass(name, strings) {
name = foo; // Noncompliant
for (var str of strings) {
str = ""; // Noncompliant
}
}The documentation shows no correct example for this rule.
Examples from the ESLint documentation.
sonarjs/no-parameter-reassignment
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-parameter-reassignment": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
OS commands should not rely on PATH resolution
Wrapper objects should not be used for primitive types
Boolean literals should not be used in comparisons