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

[@typescript-eslint/typedef] broken when used with a default parameter #784

Closed
octogonz opened this issue Jul 31, 2019 · 1 comment · Fixed by #785
Closed

[@typescript-eslint/typedef] broken when used with a default parameter #784

octogonz opened this issue Jul 31, 2019 · 1 comment · Fixed by #785
Labels
bug Something isn't working good first issue Good for newcomers has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@octogonz
Copy link
Contributor

octogonz commented Jul 31, 2019

Repro

{
  "rules": {
    "@typescript-eslint/typedef": [
      "error",
      {
        "arrayDestructuring": false,
        "arrowParameter": true,
        "memberVariableDeclaration": true,
        "parameter": true,
        "objectDestructuring": false,
        "propertyDeclaration": true,
        "variableDeclaration": true
      },
    ],
  }
}
// error @typescript-eslint/typedef: expected a type annotation
function f(x: number = 1): void {
}

Expected Result

The error should not be reported because there is a type annotation: : number

Actual Result

The error is reported.

Versions

package version
@typescript-eslint/eslint-plugin 2.0.0-alpha.4
@typescript-eslint/parser 1.13.0
TypeScript 3.5.3
ESLint 6.1.0

@JoshuaKGoldberg

@octogonz octogonz added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jul 31, 2019
@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for maintainers to take a look labels Jul 31, 2019
octogonz added a commit to octogonz/typescript-eslint that referenced this issue Jul 31, 2019
@octogonz
Copy link
Contributor Author

Here's a PR: #785

@bradzacher bradzacher added good first issue Good for newcomers has pr there is a PR raised to close this labels Aug 1, 2019
octogonz added a commit to octogonz/typescript-eslint that referenced this issue Aug 1, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 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 has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
2 participants