dejmedus / tailwind-sorter

Sorts tailwind classes in a predictable way
https://marketplace.visualstudio.com/items?itemName=dejmedus.tailwind-sorter
7 stars 2 forks source link

none of the custom prefix is working #9

Closed huyhoang160593 closed 3 months ago

huyhoang160593 commented 4 months ago

When I setting up the prefix "cn(" in the setting, they don't seem to work in the code and not sorting the classes. Things are fine if I use only string in className but with any of the prefix, they are not working.

dejmedus commented 3 months ago

Thanks for catching this!

It seems the regex wasn't happy with brackets or spaces before/after the prefix, for example in: className={twMerge( 'flex p-4')}>

You can check the added tests to see if they cover your use case.

Should be fixed in version 0.0.81, but if not, please let me know.

huyhoang160593 commented 3 months ago

Thanks for catching this!

It seems the regex wasn't happy with brackets or spaces before/after the prefix, for example in: className={twMerge( 'flex p-4')}>

You can check the added tests to see if they cover your use case.

Should be fixed in version 0.0.81, but if not, please let me know.

@dejmedus thanks you so much for the fast fix, this is now working fine with my settings