no-param-reassign with {"props": true} should catch uses of Object.assign
See original GitHub issueTell us about your environment
-
ESLint Version: 3.9.1
-
Node Version: 6.9.1
-
npm Version: 3.10.8
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
The only relevant part:
"no-param-reassign": [2, {"props": true}],
What did you do? Please include the actual source code causing the issue.
function overwriteParamUsingObjectAssign(obj) {
Object.assign(obj, {foo: 1});
}
What did you expect to happen? An error should be triggered, since properties of obj are being overwritten using Object.assign.
What actually happened? Please include the actual, raw output from ESLint. No error was triggered.
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (16 by maintainers)
Top Results From Across the Web
no-param-reassign with props, again #719 - airbnb/javascript
This is a rule we use at Airbnb - in the reducer case, if the body of your reducer is return Object.assign({}, accumulator,...
Read more >no-param-reassign - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >How to fix "no-param-reassign" eslint error? - Stack Overflow
Your existing code mutates objects in the parameter array, which is causing the linter error. Either disable the linter rule for the line, ......
Read more >Update eslintrc no-param-reassign to allow props reassignment
Update .eslintrc.yml to allow prop reassignment for the rule no-param-reassign; Removes unused eslint-disable that this change caused.
Read more >Meta programming - JavaScript - MDN Web Docs
The Proxy and Reflect objects allow you to intercept and define custom behavior for fundamental language operations (e.g. property lookup, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My opinion is that since
Object.assign
is a native language feature, it might warrant special treatment that we wouldn’t give to userland functions such aslodash.assign
.Thanks for your interest in improving ESLint. Unfortunately, it looks like this issue didn’t get enough support from the team and so I’m closing it. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach consensus after a long time tend to never do it, and as such, we close those issues. This doesn’t mean the idea isn’t interesting, just that it’s not something the team can commit to.