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

[typedef] broken for constructor argument with access modificator and default value #921

Closed
mrmlnc opened this issue Aug 29, 2019 · 1 comment
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

@mrmlnc
Copy link
Contributor

mrmlnc commented Aug 29, 2019

Related issues

Repro

{
    "parser": "@typescript-eslint/parser",
    "plugins": [
        "@typescript-eslint"
    ],
    "rules": {
        "@typescript-eslint/typedef": [
            "error",
            {
                "parameter": true
            }
        ]
    }
}
type Options = {
    force?: boolean;
}

class Something {
    // Works fine without `= {}`
    constructor(private readonly _options: Options = {}) {
        // something
    }
}

Expected Result

All fine. The output has no errors.

Actual Result

…\typescript-eslint-repro\src\index.ts
  6:17  error  expected a type annotation  @typescript-eslint/typedef

✖ 1 problem (1 error, 0 warnings)

Additional Info

The --debug argument could tell me nothing of interest.

Versions

package version
@typescript-eslint/eslint-plugin 2.0.0
@typescript-eslint/parser 2.0.0
TypeScript 3.5.3
ESLint 6.2.2
node 12.8.0
npm 6.10.2
@mrmlnc mrmlnc added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Aug 29, 2019
@bradzacher bradzacher added bug Something isn't working has pr there is a PR raised to close this and removed triage Waiting for maintainers to take a look labels Aug 29, 2019
@mrmlnc
Copy link
Contributor Author

mrmlnc commented Aug 30, 2019

Fixed by #923.

@mrmlnc mrmlnc closed this as completed Aug 30, 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 has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

2 participants