Skip to content

[adjacent-overload-signatures] False positive when static and instance methods share the same name #169

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

Closed
Jessidhia opened this issue Jan 31, 2019 · 1 comment · Fixed by #206
Labels
bug Something isn't working good first issue Good for newcomers package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@Jessidhia
Copy link
Contributor

Jessidhia commented Jan 31, 2019

Repro

/* eslint @typescript-eslint/adjacent-overload-signatures: error */
class Test {
  static test() {}
  untest() {}
  test() {}
}

Expected Result

No warning, as despite having the same names they are unrelated. The first test is a member of typeof Test, the second test is a member of Test.

Actual Result

"All 'test' signatures should be adjacent."

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 1.1.1
@typescript-eslint/parser 1.1.1
TypeScript 3.2.4
ESLint 5.12.1
node 11.8.0
yarn 1.14.0
@Jessidhia Jessidhia added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Jan 31, 2019
@j-f1 j-f1 added bug Something isn't working and removed triage Waiting for team members to take a look labels Jan 31, 2019
@armano2 armano2 added the good first issue Good for newcomers label Jan 31, 2019
@lukyth
Copy link
Contributor

lukyth commented Feb 4, 2019

Can I take a stab at this?

lukyth added a commit to lukyth/typescript-eslint that referenced this issue Feb 4, 2019
lukyth added a commit to lukyth/typescript-eslint that referenced this issue Feb 4, 2019
`adjacent-overload-signatures` rule won't distinguish between static and instance methods, despite they're different. So when they have the same name, they'll be treated as the same thing, which can cause a false positive result.

Fix typescript-eslint#169
kaicataldo pushed a commit to kaicataldo/typescript-eslint that referenced this issue Aug 27, 2019
)

* Upgrade typescript-eslint-parser to 16.0.1

* Add test case

* typescript-eslint-parser 17.0.1

Add addition tests for eslint/typescript-eslint-parser#491
@typescript-eslint typescript-eslint locked as resolved and limited conversation to collaborators Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants