You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As described here, the order of CSS classes in the class attribute does not matter.
So, to avoid conflicts, the alphabetical order is the preferred solution.
Bad:
<divclass="my-class a-class"></div>
Good:
<divclass="a-class my-class"></div>
Preliminary tasks
Find if a rule/plugin already exists
If so, set and configure
If not, create one
Not necessary for Nx-NestJS-Angular only, it could be a regular ESLint plugin used by anyone
The rule
In case no existing solution is found.
Even if the main priority is the class attribute, this ordering rule could be used to others.
For instance, if a custom attribute is used:
Context
As described here, the order of CSS classes in the
class
attribute does not matter.So, to avoid conflicts, the alphabetical order is the preferred solution.
Bad:
Good:
Preliminary tasks
ESLint
plugin used by anyoneThe rule
Even if the main priority is the
class
attribute, this ordering rule could be used to others.For instance, if a custom attribute is used:
So it is more a
eslint-html-attr-ordering
plugin.Specs
An error should be returned values inside an attribute are not ordered.
The rule should allow the following configuration:
a->z
orz->a
The configuration should probably by an array.
It could look like:
The text was updated successfully, but these errors were encountered: