Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Sort class names in JSX className attributes #108

Closed
wincent opened this issue Oct 17, 2019 · 0 comments · Fixed by #114
Closed

Sort class names in JSX className attributes #108

wincent opened this issue Oct 17, 2019 · 0 comments · Fixed by #114
Labels

Comments

@wincent
Copy link
Contributor

wincent commented Oct 17, 2019

As requested by Brian here:

brianchandotcom/liferay-portal#79628 (comment)

We want to enforce sorting in the className attribute here:

<div className="a b c d"></div>

Note that classname can be a complex attribute (for example, we often use the classNames() function to return a string containing names, derived from an object or array), and those cases will be handled at least in part by the sort-keys rule, but we should handle the simple string case.

wincent added a commit that referenced this issue Oct 18, 2019
wincent added a commit that referenced this issue Oct 21, 2019
wincent added a commit that referenced this issue Oct 21, 2019
wincent added a commit that referenced this issue Oct 21, 2019
This so that I can add a rule that checks for duplicate class names and
split off the whitespace check into a separate rule.
wincent added a commit that referenced this issue Oct 21, 2019
So that we have each rule doing exactly one thing.
wincent added a commit that referenced this issue Oct 21, 2019
feat!: add no-duplicate-class-names, sort-class-names, trim-class-names rules (#108)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
1 participant