New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accidental bypass for react/jsx-no-bind allowArrowFunctions #1395
Comments
It's not realistic for a rule to always be exhaustive; there's often a way to trick them. However, it seems reasonable that an arrow function in the same scope should be warned on. |
Agreed. The primary concern was that for someone not familiar with the implications of anonymous functions in props, they might think the rules is just stylistic. I think checking current scope would reject the 99% case of extracting to a variable. |
We've recently started to get rid of our usage of arrow functions in component props for similar reasons to that mentioned here. We went ahead and set:
but realized we were still able to get away with using something like:
So we didn't fix the problem, we just accidentally tricked it. Is this expected behavior or is this a bug?
The text was updated successfully, but these errors were encountered: