Skip to content

[@typescript-eslint/indent] Flase positives in generics containing parentheses #1700

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
neurolag opened this issue Mar 7, 2020 · 1 comment
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@neurolag
Copy link
Contributor

neurolag commented Mar 7, 2020

Repro

{
  "rules": {
    "@typescript-eslint/indent": "warn"
  }
}
        new Array<number>(
            null,
            null); // Works as expected
        Array.from<number, number>(
            [],
            () => null); // Works as expected
        new Array<() => number>(
            null,
            null); // Expected indentation of 8 spaces but found 12. (@typescript-eslint/indent)
        Array.from<() => number, number>(
            [],
            () => null); // Expected indentation of 8 spaces but found 12. (@typescript-eslint/indent)
        Array.from<number, () => number>(
            [],
            () => null); // Expected indentation of 8 spaces but found 12. (@typescript-eslint/indent)
        Array.from<(number), number>(
            [],
            () => null); // Expected indentation of 8 spaces but found 12. (@typescript-eslint/indent)

Expected Result
No error should be reported in all cases.

Actual Result
In all cases where a generic contains parentheses a warning is issued.

Versions

package version
@typescript-eslint/eslint-plugin 2.22.1-alpha.6
@typescript-eslint/parser 2.22.0
TypeScript 3.8.3
ESLint 6.8.0
node v12.4.0
npm 6.9.0
@neurolag neurolag added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Mar 7, 2020
@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for team members to take a look labels Mar 7, 2020
@bradzacher bradzacher added this to the indent rewrite milestone Mar 7, 2020
@bradzacher
Copy link
Member

Merging into #1824

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

2 participants