findMutating
matches beyond standard array functions
#1579
Labels
findMutating
matches beyond standard array functions
#1579
Checklist
Tell us about your environment
Please show your full configuration:
What did you do?
What did you expect to happen?
This rule should not warn because it does not match the standard array functions.
What actually happened?
error Unexpected mutation of "prop" prop vue/no-mutating-props
Repository to reproduce this issue
This issue is caused by the regex here:
/^push|pop|shift|unshift|reverse|splice|sort|copyWithin|fill$/u
Currently, the starting and ending anchors only apply to the first (push) and last (fill) strings. I don't think this is the intended behavior because it matches many other functions. See here for some examples.
Adding parentheses makes the regex perform more like I imagine was intended:
/^(push|pop|shift|unshift|reverse|splice|sort|copyWithin|fill)$/u
Here are the results.
The text was updated successfully, but these errors were encountered: