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

Indentation not normalized inside typescript generic type arguments #409

Open
5 tasks done
IlyaSemenov opened this issue Feb 25, 2024 · 1 comment
Open
5 tasks done
Labels

Comments

@IlyaSemenov
Copy link

IlyaSemenov commented Feb 25, 2024

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.
@antfu antfu added the upstream label May 2, 2024
@antfu
Copy link
Owner

antfu commented May 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants