eslint-plugin-unocss
eslint-plugin-unocss copied to clipboard
Broken classes on eslint --fix due to variant groups
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:
- Do not change anything in the code. Just add documentation.
- Export another rule, called
unocss/classnames-order-no-groupsor the like, which can be enabled in place ofunocss/classnames-order. - Disable grouping with
unocss/classnames-orderand export another rule calledunocss/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.