Skip to content

[explicit-module-boundary-types] Requires return type on overloaded constructors #2163

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
sveyret opened this issue Jun 3, 2020 · 2 comments
Labels
duplicate This issue or pull request already exists package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@sveyret
Copy link
Contributor

sveyret commented Jun 3, 2020

Repro

{
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/eslint-recommended",
    "plugin:@typescript-eslint/recommended",
    "prettier",
    "prettier/@typescript-eslint"
  ],
  "rules": {
    "@typescript-eslint/explicit-function-return-type": "off"
  }
}
export default class MyClass {
  public constructor()
  public constructor(
    specialKeyPrefix: string
  )
  public constructor(
    private readonly specialKeyPrefix: string = '.'
  ) {}
}

Expected Result

No warning.

Actual Result

Both constructor declarations (not the implementation) are emitting the following warning:

2:21  warning  Missing return type on function  @typescript-eslint/explicit-module-boundary-types
3:21  warning  Missing return type on function  @typescript-eslint/explicit-module-boundary-types

Versions

package version
@typescript-eslint/eslint-plugin 3.1.0
@typescript-eslint/parser 3.1.0
TypeScript 3.9.3
ESLint 7.1.0
node 14.2.0
@sveyret sveyret added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Jun 3, 2020
@bradzacher bradzacher added duplicate This issue or pull request already exists and removed triage Waiting for team members to take a look labels Jun 3, 2020
@bradzacher
Copy link
Member

See #2150

Please use the search next time

@sveyret
Copy link
Contributor Author

sveyret commented Jun 3, 2020

Sorry for the duplicate. I used search, but probably missed the issue because already closed.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

2 participants