eslint-config icon indicating copy to clipboard operation
eslint-config copied to clipboard

Indentation not normalized inside typescript generic type arguments

Open IlyaSemenov opened this issue 1 year ago • 1 comments

Describe the bug

In a typescript generic with multiline type arguments, indentation is not normalized.

That means, the following code is left as is:

export type A = NonNullable<
string
>

export type B = NonNullable<
                                         string
>

Expected:

export type A = NonNullable<
  string
>

export type B = NonNullable<
  string
>

Reproduction

https://stackblitz.com/edit/stackblitz-starters-q3rvuw?file=test.ts

Run: pnpm eslint test.ts

You will see that the two interface fields are reported to be indented incorrectly, but the two generics are mistakenly considered to be fine.

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.14.0 - /usr/local/bin/pnpm

Used Package Manager

pnpm

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • [X] The provided reproduction is a minimal reproducible of the bug.

IlyaSemenov avatar Feb 25 '24 12:02 IlyaSemenov

You may want to report to https://github.com/eslint-stylistic/eslint-stylistic instead.

antfu avatar May 02 '24 18:05 antfu