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
Fix: object-shorthand should only lint computed methods (fixes #6015) #6024
Conversation
LGTM |
By analyzing the blame information on this pull request, we identified @lemonmade, @vitorbal and @nzakas to be potential reviewers |
LGTM 👍 |
LGTM |
Sorry for introducing this bug :( |
@@ -109,7 +109,7 @@ module.exports = { | |||
} | |||
|
|||
// only computed methods can fail the following checks | |||
if (!APPLY_TO_METHODS && node.computed) { | |||
if ((!APPLY_TO_METHODS || node.value.type !== "FunctionExpression") && node.computed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can drop the !APPLY_TO_METHODS
check, the only computed case we care about is node.value.type === "FunctionExpression" && node.computed
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense - thanks!
@lemonmade No need to apologize - it's part of the process of making things better :) |
LGTM |
Updated with @lemonmade's suggestion and added one more test |
Lgtm |
No description provided.