A plugin pack of order related linting rules for stylelint.
npm install stylelint-order
Add stylelint-order
to your stylelint config plugins array, then add rules you need to the rules list. All rules from stylelint-order need to be namespaced with order
.
Like so:
// .stylelintrc
{
"plugins": [
"stylelint-order"
],
"rules": {
// ...
"order/order": [
"custom-properties",
"declarations"
],
"order/properties-alphabetical-order": true
// ...
}
}
order
: Specify the order of content within declaration blocks.properties-order
: Specify the order of properties within declaration blocks.properties-alphabetical-order
: Specify the alphabetical order of properties within declaration blocks.
properties-order
and properties-alphabetical-order
code and readme are based on declaration-block-properties-order
rule which was a stylelint's core rule prior stylelint 8.0.0.