devunt / devunt/eslint-plugin-unocss

Broken classes on eslint --fix due to variant groups

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
84
Forks
2
PR merge metrics
No merged PRs in 30d

Description

The `unocss/classnames-order` rule seems to group classes by default when executing `eslint --fix` according to the [variant group feature](https://windicss.org/features/variant-groups.html), which is nice. However, if the [Variant group transformer](https://unocss.dev/transformers/variant-group) 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.