-
Notifications
You must be signed in to change notification settings - Fork 659
Suggestion: noAssignInExpressions
fixer is incorrect
#4717
Comments
noAssignInExpressions
fixer is incorrectnoAssignInExpressions
fixer is incorrect
This is more a suggestion than a bug. The fix is marked as unsafe. |
Maybe this is where the issue is? The vscode plugin is automatically making the fix in the screenshot and I did not opt into anything unsafe. |
It's possible you changed your VSCode settings to accept these changes automatically |
Are you sure we should remove the suggested fix? |
I don't believe I have set anything regarding unsafe changes (aside from |
Yeah, that's the configuration that applies code changes on save :) There isn't a distinction between safe and unsafe code changes at the moment. |
It seems that some users deliberately use assignments in some expression kinds (conditionals, inline arrow functions). A user can then be very surprised by the suggestion even in unsafe mode. |
Environment information
What happened?
The fixer for
noAssignInExpressions
is transforming the statement to an equivalency check rather than the intended assignment.Expected result
I'm not sure there should be a fixer on this rule without understanding the intent.
Code of Conduct
The text was updated successfully, but these errors were encountered: