Skip to content

[no-untyped-public-signature] Throws on constructor, when a constructor can't have a return type #1229

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
garyking opened this issue Nov 19, 2019 · 0 comments · Fixed by #1231
Labels
bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@garyking
Copy link
Contributor

garyking commented Nov 19, 2019

Repro

{
  "rules": {
    "@typescript-eslint/no-untyped-public-signature": "error"
  }
}
export default class Foo {
  private readonly urlPath: string;

  /**
   * Public method has no return type
   *
   * eslint(@typescript-eslint/no-untyped-public-signature)
   */
  public constructor(urlPath: string) {
    this.urlPath = urlPath;
  }
}

Expected Result

No error, because constructor can't have return type.

Actual Result

The error as shown in the comments.

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 2.8.0
@typescript-eslint/parser 2.8.0
TypeScript 3.7.2
ESLint 6.6.0
node v12.12.0
npm 6.13.1
@garyking garyking added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Nov 19, 2019
@bradzacher bradzacher added bug Something isn't working has pr there is a PR raised to close this and removed triage Waiting for team members to take a look labels Nov 19, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants