-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
turn off unicorn/template-indent
#269
Conversation
@gurgunday Can you show an example where there’s a conflict? |
Sure, here, Prettier is OK with this, but unicorn complains
const ShopItemPanelImage = (it) => {
return html`
<li class="carousel-item relative w-full" data-index="${it.i}">
!${it.i === -1
? ""
: html`
<button
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
class="fill-current"
>
<title>Trash Icon</title>
<path
d="M6 7H5v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7H6zm10.618-3L15 2H9L7.382 4H3v2h18V4z"
></path>
</svg>
</button>
`}
<img
onclick="uploadShopItemBanner(this)"
src="${it.i === -1
? "/p/assets/img/shopBannerImage.png"
: `${process.env.S3_CDN_URI}/userAssets/${it.user.id}/shop/${it.item.productID}/bannerPic${it.i}.webp`}"
width="640"
height="360"
class="cursor-pointer !brightness-100 brightness-50 transition-[filter] duration-500 hover:!brightness-50"
alt="${it.item.productName} banner image"
/>
</li>
`;
}; |
Thanks! To me, the rule seems useful even with Prettier, as long as you configure the rule to not care about the same tags and comments as Prettier does. For example, the So maybe it should be marked as a special rule. It looks like the CLI tool might be able to validate the configuration, but I haven’t looked into it deeply. |
I can keep em all except html 😁 |
I think it's better now Not sure how a special rule works, does that just mean there should be documentation on what happens? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is your take on:
We should look into if it’s feasible to make a validator for it: f5530d3/bin/validators.js
Co-authored-by: Simon Lydell <[email protected]>
Couldn't find weather Prettier formats templates using comments or not So I only checked for tags Is there a resource where I can find that information? |
The only resource I know of is the source code that I linked to earlier: https://github.com/prettier/prettier/tree/main/src/language-js/embed There you can see that there’s an |
I will check if there are other tag keywords |
https://github.com/search?q=repo%3Aprettier%2Fprettier+tag.name&type=code All of the tags seem to have been taken into account if I'm not missing anything |
Looking good! I’m hoping to get some time for some testing on my own, merging and releasing soon! |
Released in v9.1.0. Thank you for the help! 💯 |
It conflicts with Prettier's template indenting