Skip to content

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

Closed
@neurolag

Description

@neurolag

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions