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

indent: bad indentation in chained methods calls with generics #270

Open
3 of 5 tasks
paztis opened this issue Jan 18, 2024 · 0 comments
Open
3 of 5 tasks

indent: bad indentation in chained methods calls with generics #270

paztis opened this issue Jan 18, 2024 · 0 comments
Labels
accepted The propsal get accepted, PR welcome!

Comments

@paztis
Copy link

paztis commented Jan 18, 2024

Validations

Describe the bug

when chaining methods, if one of the method contains generics, the indentation computing fails
In below case it is the reducer function: its callback ask indentation of 2 instead of indentation of 4

const map: Record<string, string> = {};

const map2 = Object.keys(map)
  .filter((key) => true)
  .reduce<Record<string, string>>((result, key) => {
    result[key] = map[key];
    return result;
  }, {});
  6:1  error  Expected indentation of 2 spaces but found 4  @stylistic/indent
  7:1  error  Expected indentation of 2 spaces but found 4  @stylistic/indent
  8:1  error  Expected indentation of 0 spaces but found 2  @stylistic/indent

✖ 3 problems (3 errors, 0 warnings)
  3 errors and 0 warnings potentially fixable with the `--fix` option.

Reproduction

https://stackblitz.com/edit/github-caheqy?file=src%2Findex.ts

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests
@kecrily kecrily added the accepted The propsal get accepted, PR welcome! label Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The propsal get accepted, PR welcome!
Projects
None yet
Development

No branches or pull requests

2 participants