Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
no-extra-bind fix could be unsafe #10846
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
Please show your full configuration:
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
I noticed that
What did you expect to happen?
What actually happened? Please include the actual, raw output from ESLint.
I could take a crack at fixing this but it'd be helpful to know if there are already established patterns for checking if a node is "side-effect-free"?
Thanks for the report, I can reproduce this issue.
Not that I know of. I think the list of "side-effect-free" nodes is fairly small -- it seems like it would typically just contain identifiers, literals, and function expressions. (There are some other cases where things could be guaranteed to be side-effect-free, such as empty objects or class expressions without any computed method names, but it doesn't seem necessary to cover every case since this just affects whether an autofix is attempted.)