Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Duplicated name error when doing method overload in a class #434

Closed
ypconstante opened this issue Jan 11, 2018 · 4 comments
Closed

Duplicated name error when doing method overload in a class #434

ypconstante opened this issue Jan 11, 2018 · 4 comments

Comments

@ypconstante
Copy link

What version of TypeScript are you using?
2.6.2

What version of typescript-eslint-parser are you using?
11.0.0

What code were you trying to parse?

class Example {
    public doThing(type: string): void;
    public doThing(idType: number): void;
    public doThing(type: string | number): void {
    }
}

What did you expect to happen?
No errors when running with no-dupe-class-members rule enabled and method overload in the class.

What happened?

  3:5   error    Duplicate name 'doThing'             no-dupe-class-members
  4:5   error    Duplicate name 'doThing'             no-dupe-class-members
@JamesHenry
Copy link
Member

Thanks for reporting @ypconstante, can't say I've ever used this lint rule myself. This might be a case of having to develop an alternative rule within eslint-plugin-typescript

@iFwu
Copy link

iFwu commented Jan 9, 2019

I also have this problem.
My code is declaration of class.

@armano2
Copy link
Contributor

armano2 commented Jan 9, 2019

This is solved in new v21 and for declaration classes will be fixed in #592

@JamesHenry
Copy link
Member

Sounds like all the points raised in this issue will be fixed by the new release, which we will be doing very soon from https://github.com/typescript-eslint/typescript-eslint

Feel free to open a new issue over there if you experience any issues with the next release.

Thanks!

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

No branches or pull requests

4 participants