prettier / eslint-config-prettier

Turns off all rules that are unnecessary or might conflict with Prettier.
MIT License
5.34k stars 251 forks source link

Remove `unicorn/template-indent` #281

Open fisker opened 4 months ago

fisker commented 4 months ago

I don't understand how it conflicts with Prettier.

It's been enabled in Prettier codebase since the rule released. https://github.com/prettier/prettier/pull/12469 I never see any conflicts.

Quote from https://github.com/prettier/eslint-config-prettier/pull/269#issuecomment-1807580963

Sure, here, Prettier is OK with this, but unicorn complains

This doesn't mean they are conflicting.

lydell commented 4 months ago

https://github.com/prettier/eslint-config-prettier?tab=readme-ov-file#unicorntemplate-indent

Prettier and the rule unfortunately disagree about the indentation in ternaries:

condition
  ? null
  : html`
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui
        mauris.
      </p>
    `;

There are many rules that conflict only sometimes, which means that you can use them with Prettier if you know what you’re doing. But the point of eslint-config-prettier is to help people get a conflict-free ESLint+Prettier setup (not everyone is an expert).

fisker commented 4 months ago

Nice catch, I'll fix this on eslint-plugin-unicorn side.

fisker commented 1 day ago

Turns out this is hard to fix... It's not easy to know which character to align.