eslint-plugin-tailwindcss icon indicating copy to clipboard operation
eslint-plugin-tailwindcss copied to clipboard

[Feature request] tailwind-merge, clsx & classnames support

Open SanderCokart opened this issue 1 year ago • 6 comments

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

SanderCokart avatar Jun 07 '23 09:06 SanderCokart

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.

bezbac avatar Jun 07 '23 11:06 bezbac

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.

These functions are commonly used in the ecosystem, maybe consider adding them as defaults?

ariesclark avatar Jul 17 '23 22:07 ariesclark

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.

This was super helpful 🥇

joaopedrodcf avatar Dec 27 '23 16:12 joaopedrodcf

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.

Thanks!

aguirrealvaro avatar Jan 19 '24 03:01 aguirrealvaro