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

Make no-dupe-keys compare tokens (like no-duplicate-case does) #13599

Closed
robatwilliams opened this issue Aug 21, 2020 · 3 comments
Closed

Make no-dupe-keys compare tokens (like no-duplicate-case does) #13599

robatwilliams opened this issue Aug 21, 2020 · 3 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion auto closed The bot closed this issue enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules

Comments

@robatwilliams
Copy link
Contributor

I see this was originally raised as #12070 (closed). Recently #13485 made no-duplicate-case compare tokens. Seems the same arguments would apply to both and it'd make sense for both rules to work the same way?

What rule do you want to change?
no-dupe-keys

Does this change cause the rule to produce more or fewer warnings?
More

How will the change be implemented? (New option, new default behavior, etc.)?
Default behaviour

Please provide some example code that this change will affect:

const foo = {
  [a]: 1,
  [a]: 2
};

What does the rule currently do for this code?
No error

What will the rule do after it's changed?
Error

Are you willing to submit a pull request to implement this change?
I'm afraid not

@robatwilliams robatwilliams added enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules triage An ESLint team member will look at this issue soon labels Aug 21, 2020
@anikethsaha
Copy link
Member

Thanks for the issue.

As mentioned #12070 already, there may be few cases still being passed by. But checking the identifier behind an option and documenting some of the cases where it would still give false positive makes sense to me as personally I faced some similar issue as well.

@anikethsaha anikethsaha added evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Aug 21, 2020
@mdjermanovic
Copy link
Member

mdjermanovic commented Aug 21, 2020

Recently #13485 made no-duplicate-case compare tokens. Seems the same arguments would apply to both and it'd make sense for both rules to work the same way?

I think it isn't quite the same.

no-duplicate-case was already based on comparing expressions. We changed the algorithm, which just slightly changed the behavior.

For no-dupe-keys, this looks like a much bigger change in behavior: from comparing only static values to comparing expressions.

That said, I'd support this feature, but only if it would be implemented behind an option.

@eslint-deprecated eslint-deprecated bot added the auto closed The bot closed this issue label Sep 22, 2020
@eslint-deprecated
Copy link

Unfortunately, it looks like there wasn't enough interest from the team
or community to implement this change. While we wish we'd be able to
accommodate everyone's requests, we do need to prioritize. We've found
that issues failing to reach accepted status after 21 days tend to
never be accepted, and as such, we close those issues.
This doesn't mean the idea isn't interesting or useful, just that it's
not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Mar 22, 2021
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Mar 22, 2021
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 auto closed The bot closed this issue enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

3 participants