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

Broken classes on eslint --fix due to variant groups

Open borisdiakur opened this issue 2 years ago • 0 comments

The unocss/classnames-order rule seems to group classes by default when executing eslint --fix according to the variant group feature, which is nice. However, if the Variant group transformer is not enabled, the resulting CSS classes do not have any effect.

I see three possible solutions for this:

  1. Do not change anything in the code. Just add documentation.
  2. Export another rule, called unocss/classnames-order-no-groups or the like, which can be enabled in place of unocss/classnames-order.
  3. Disable grouping with unocss/classnames-order and export another rule called unocss/variant-groups, which enables grouping.

I would personally prefer the third option, because it doesn't force me to use variant groups, but instead allows me to opt in for the feature. It also is "cleaner" than the second solution, because the second solution would have two conflicting rules (you must either enable the first or the latter), while the third solution has two rules which are complementary.

borisdiakur avatar May 14 '23 19:05 borisdiakur