-
Notifications
You must be signed in to change notification settings - Fork 46
Create group-attrs rule #383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hi @reteps thanks for the suggestion, how about providing this feature as an option for |
@yeonjuan that sounds great! I'm happy to make that change if you suggest how you think the two should work together. |
I'm thinking that the default |
Awesome! I think the rule should take grouping into account when the
And I think regex support might be necessary for attributes patterns like "sort-attrs": ["error": {
"group": [
["id", "type"],
["^aria-", ... ]
["^data-", ...]
]
}
}] think the "sort-attrs" ["error", { group: "related" }] |
I want
One concern I have is that the sorting in
We can't automatically fix this behavior, and shouldn't omit a One issue I have is that groups should not be best effort for templating:
I can't think of how to handle this case when I'm not sure how best to handle this:
I'm thinking that the sorting should be best effort, and grouping violations are ignored if moving the attribute could have different semantic meaning (e.g. the field is separated by a templated parameter). @yeonjuan any thoughts? |
Description
Creates a rule for grouping related attributes together. Essentially a more relaxed version of
@html-eslint/sort-attrs
, that gives more flexibility for semantic grouping.Disclaimer: