Closed arnarthor closed 2 years ago
Thanks for the report!
Unfortunately, I'm not sure there is any way to reasonably detect if .map
is called on an Immutable.js object or something else. Any ideas on how we might solve this?
If we can't come up with anything, I think the best we can do is add a note to the documentation about this.
Yup definitely. I didn't expect this to get fixed since it's a really hard problem to solve. But adding something to the docs would be beneficial.
Also regarding if #1049 gets through to make sure it's expressed as part of the recommended setup.
Otherwise awesome stuff, hadn't thought about this one when assigning my keys 👍
Happy to review a PR to the docs; I agree that it's not really possible to know when .map
is called on immutableJS specifically.
This rule seems really useful, but at the same time it can be frustrating with ImmutableJS.
It seems that the rule is only checking for
.map
with 2 arguments and assuming the latter one is the index here.The counter example for that is here
This causes an error in this rule wrongfully since
key
does not have the same behaviour as an array index.