Closed ianmcburnie closed 6 years ago
Agree, it makes sense. @mwoo shall I go ahead and make the change?
That also makes sense to me. Thanks, @ianmcburnie for bringing this up.
I have made the change and published new version (@0.1.6).
Thanks guys.
Current rule:
Proposed rule:
Can we go with the default eslint config for no-param-reassign? The default sets props to false. This will still disallow reassignment of the param, but will allow reassignment of properties on that param (which is a fairly common thing to do on the client).
For example, right now this is will be a lint error:
Which seems a lot less harmless than the following:
So is there a reason why we decided to disable property re-assignment too? Perhaps it's more of an issue for server side script than DOM manipulation...?
For a more real life example, this is where I ran into this error:
I would have to rewrite it like this, with the current rule:
Further reading: