antfu / eslint-config

Anthony's ESLint config preset

Home Page:https://eslint-config.antfu.me/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Indentation not normalized inside typescript generic type arguments

IlyaSemenov opened this issue · 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

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