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: no-dupe-keys false negative (fixes #6801) #6863

Merged
merged 1 commit into from Aug 10, 2016
Merged

Fix: no-dupe-keys false negative (fixes #6801) #6863

merged 1 commit into from Aug 10, 2016

Conversation

mysticatea
Copy link
Member

Fixes #6801.

This PR fixes a false negative between a normal property and a getter/setter.
In addition, I upgrade code by ES2015.

This commit fixes a false negative between a normal property and a
getter/setter.
In addition, I upgrade code by ES2015.
@mention-bot
Copy link

@mysticatea, thanks for your PR! By analyzing the annotation information on this pull request, we identified @vitorbal, @nzakas and @iancmyers to be potential reviewers

@eslintbot
Copy link

LGTM

// Helpers
//------------------------------------------------------------------------------

const GET_KIND = /^(?:init|get)$/;
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I'm not sure what the first part of this regEx is supposed to check?

Copy link
Member Author

@mysticatea mysticatea Aug 9, 2016

Choose a reason for hiding this comment

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

Normal property's kind is "init". This regexp is handling normal properties as getter/setter pair. As a result, this rule will address {a: 1, get a() {}} as duplicate keys. This is the purpose of this PR :)

Copy link
Member

Choose a reason for hiding this comment

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

Ah, OK, now I understand, thanks.

@nzakas
Copy link
Member

nzakas commented Aug 10, 2016

Lgtm

@nzakas nzakas merged commit 11395ca into master Aug 10, 2016
@mysticatea mysticatea deleted the issue6801 branch August 11, 2016 12:18
@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.

no-dupe-keys: false negative between a normal property and a getter.
6 participants