Package Exports
- stylelint-order
- stylelint-order/rules/properties-order
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (stylelint-order) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
stylelint-order

A plugin pack of order related linting rules for stylelint. Every rule support autofixing (stylelint --fix
).
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/order": [
"custom-properties",
"declarations"
],
"order/properties-alphabetical-order": true
// ...
}
}
List of rules
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.
Autofixing
Every rule support autofixing (stylelint --fix
). postcss-sorting is using internally for order autofixing.
Automatic sortings has some limitation, which are described for every rule if any. Please, take a look at how comments are handled by postcss-sorting.
Autofixing is enabled by default if it's enabled in stylelint configuration. Autofixing can be disabled on per rule basis using disableFix: true
secondary option. E. g.:
{
"rules": {
"order/order": [
[
"custom-properties",
"declarations"
],
{
"disableFix": true
}
]
}
}
Less isn't supported. It might work, but haven't tested.
Thanks
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.