question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no-param-reassign with {"props": true} should catch uses of Object.assign

See original GitHub issue

Tell 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:closed
  • Created 7 years ago
  • Comments:17 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
not-an-aardvarkcommented, Nov 9, 2016

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 as lodash.assign.

0reactions
not-an-aardvarkcommented, Jul 11, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found