stylelint-order ![Build Status](https://camo.githubusercontent.com/cf3328881c8674fca1410a38f2c24c9854c139720c8f3ba47a28a6ea1eebf756/68747470733a2f2f7472617669732d63692e6f72672f6875646f6368656e6b6f762f7374796c656c696e742d6f726465722e737667)
A plugin pack of order related linting rules for stylelint.
Installation
npm install stylelint-order
Usage
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/declaration-block-order": [
"custom-properties",
"declarations"
],
"order/declaration-block-properties-alphabetical-order": true
// ...
}
}
List of rules
declaration-block-order
: Specify the order of content within declaration blocks.declaration-block-properties-specified-order
: Specify the almost strict order of properties within declaration blocks.declaration-block-properties-alphabetical-order
: Specify the alphabetical order of properties within declaration blocks.declaration-block-property-groups-structure
: Require or disallow an empty line before property groups.
Thanks
declaration-block-properties-specified-order
and declaration-block-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.