eslint-plugin-tailwindcss
eslint-plugin-tailwindcss copied to clipboard
[Feature request] tailwind-merge, clsx & classnames support
Is your feature request related to a problem? Please describe. this eslint plguin cannot detect classnames within anything other than the class,className html tag. This means clsx, classnames and tailwind-merge do no enforce the rules.
Describe the solution you'd like At least I would like tailwind-merge to be supported so that classname orders work for tailwind-merge
Describe alternatives you've considered None
Additional context
className={twMerge/twJoin(
'h-full w-full fill-transparent stroke-white stroke-2 drop-shadow-[#000_0_0_8px] transition-[color]',
selectedPickupPoint === pickupPoint && 'fill-success'
)}
https://github.com/dcastil/tailwind-merge
Hey @SanderCokart. There is a configuration option on most of the rules called "callees" (See here)
By using it, you should be able to get the rules to work with twMerge
or twJoin
.
I'm using the library with clsx
and it works for me.
Hey @SanderCokart. There is a configuration option on most of the rules called "callees" (See here) By using it, you should be able to get the rules to work with
twMerge
ortwJoin
. I'm using the library withclsx
and it works for me.
These functions are commonly used in the ecosystem, maybe consider adding them as defaults?
Hey @SanderCokart. There is a configuration option on most of the rules called "callees" (See here) By using it, you should be able to get the rules to work with
twMerge
ortwJoin
. I'm using the library withclsx
and it works for me.
This was super helpful 🥇
Hey @SanderCokart. There is a configuration option on most of the rules called "callees" (See here) By using it, you should be able to get the rules to work with
twMerge
ortwJoin
. I'm using the library withclsx
and it works for me.
Thanks!