phanect/eslint-plugin-editorconfig

editorconfig/indent: Multi-line TypeScript generic support problem

prometheas opened this issue · 2 comments

Hey, folks! I encountered a "battle condition" between Prettier and editorconfig/indent that affects the following line of code:

export class SomeClass {
  private registeredOpts = {} as Record<
    string,
    ApiTokenProviderServiceRegistrationOptions
  >;
}

When formatted like this, ESLint reports "Expected indentation of 2 spaces but found 4" from editorconfig/indent for both generics items of Record, but fixing that results in "Insert ··" from prettier/prettier.

Hoping it's possible to make the rule allow for indentation of multi-line TypeScript generics declarations… 🤞😅

@prometheas Apologies for not responding for long. I forgot to reply... 😅

I tried to make a repro, but I could not reproduce it on my end.

https://github.com/phanect/repro-eslint-plugin-editorconfig-and-prettier

You can run npm run eslint to run ESLint, and npm run prettier to format by Prettier. Both didn't complain about the indents.

This issue might be fixed by ESLint's update, but if this issue still happens, can you create a repro?
You can send Pull Request to my repro above or create by yourself.
Or if your source code is publicly available, let me know the URL for the repository.

Closing due to no response for now, but feel free to reopen this if you found this issue still exists.