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

Remove unicorn/template-indent #281

Open
fisker opened this issue Feb 24, 2024 · 2 comments
Open

Remove unicorn/template-indent #281

fisker opened this issue Feb 24, 2024 · 2 comments

Comments

@fisker
Copy link
Member

fisker commented Feb 24, 2024

I don't understand how it conflicts with Prettier.

It's been enabled in Prettier codebase since the rule released. prettier/prettier#12469
I never see any conflicts.

Quote from #269 (comment)

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

This doesn't mean they are conflicting.

@lydell
Copy link
Member

lydell commented Feb 24, 2024

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
Copy link
Member Author

fisker commented Feb 25, 2024

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

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

No branches or pull requests

2 participants