no-mutating-assign and functions
See original GitHub issueThis doesn’t pass the no-mutating-assign rule:
Object.assign(() => {}, {foo:1});
Should it be allowed?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
eslint-plugin-fp - npm
ESLint rules for functional programming. ... no-mutating-assign - Forbid the use of Object.assign() with a variable as first argument.
Read more >Found the ESLint plugin preventing mutation in Object.assign ...
Use JS object spread operator instead of Object.assign() pattern in Node 8. One of the best features of Node 8.6+ is the ability...
Read more >Eslint-plugin-fp NPM - npm.io
ESLint rules for functional programming ... no-mutating-assign - Forbid the use of Object.assign() with a variable as first argument. no-mutating-methods ...
Read more >Functional Fashion in JavaScript | Blog - Fluid Attacks
Now we rewrite this code in a functional way. Cilinder class in a functional approach. function cilinder(radius, height) { return { " ...
Read more >Here's How Not to Suck at JavaScript - Agile Actors #learning
Although I'm a strong believer in Functional Programming, I'm not going ... rules: fp/no-mutating-assign: warn fp/no-mutating-methods: warn ...
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
I can see:
being preferred to:
Hey thanks! I upgraded and was able to remove my comments disabling the rule.
You’re right that
no-mutation
is the error I get when trying to assignpropTypes
the old-fashioned way. I think I assumedno-unused-expression
because that’s the error I’ve been seeing the most lately as I try to write in a more functional style.I didn’t know about the
exceptions
property so thanks for that. I agree that passing an arrow function toObject.assign
looks very funny. Just trying it out for now.Thanks again for the awesome plugin!