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

The no-dupe-keys rule complains about legal duplicated keys in a declared class #133

Closed
object88 opened this issue Oct 19, 2016 · 2 comments
Assignees
Labels

Comments

@object88
Copy link
Contributor

Take, for instance, this Flow class:

//@flow
...
declare class ProjectClass extends Map<any, any> {
  get(key: 'id'): number;
  get(key: 'children'): List<Project>;
}

The ESLint engine complains,

flowtype/no-dupe-keys Duplicate property.: /Users/pairing/[...]/ProjectModalBody.js:1

However, it's allowed to have two get methods, as they are differentiated with different keys. It would be great for the dupe rule to be aware of this and allow it.

@danharper
Copy link
Collaborator

👍 good spot

@danharper danharper added the bug label Oct 19, 2016
@object88
Copy link
Contributor Author

I am starting to take a look at a fix now. A little more complicated than I had initially expected, but will comment here if I get stuck or have something to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants