Skip to content
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

Merged
merged 1 commit into from May 3, 2016

Conversation

kaicataldo
Copy link
Member

No description provided.

@eslintbot
Copy link

LGTM

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @lemonmade, @vitorbal and @nzakas to be potential reviewers

@mysticatea
Copy link
Member

LGTM 👍

@afc163
Copy link

afc163 commented May 2, 2016

LGTM

@lemonmade
Copy link
Contributor

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) {
Copy link
Contributor

@lemonmade lemonmade May 2, 2016

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense - thanks!

@kaicataldo
Copy link
Member Author

kaicataldo commented May 2, 2016

@lemonmade No need to apologize - it's part of the process of making things better :)

@eslintbot
Copy link

LGTM

@kaicataldo
Copy link
Member Author

Updated with @lemonmade's suggestion and added one more test

@nzakas
Copy link
Member

nzakas commented May 3, 2016

Lgtm

@nzakas nzakas merged commit ef8cbff into master May 3, 2016
@alberto alberto deleted the fixes6015 branch May 4, 2016 22:17
afc163 added a commit to ant-design/ant-design that referenced this pull request May 6, 2016
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants