stylelint-config-rational-order
stylelint-config-rational-order copied to clipboard
The plugin does not do a thing
With this css:
h1 {
position: absolute;
display: block;
float: right;
color: black;
background-color: blue;
border: 1px black solid;
}
This configuration (basically copy/pasta).
{
"extends": [
"stylelint-config-standard",
"stylelint-config-rational-order"
],
"plugins": [
"stylelint-order",
"stylelint-config-rational-order/plugin"
],
"rules": {
"order/properties-order": [],
"plugin/rational-order": [true, {
"border-in-box-model": false,
"empty-line-between-groups": true,
}]
}
}
And the command:
stylelint --config config/.stylelintrc --fix fixtures/main.css
Strictly nothing happen.
It looks like your CSS file has already been sorted according to the plugin settings. Try to reorder rules and run the command again to make sure the plugin works.
same issue here :
I have this minimal config :
{
"extends": [
"stylelint-config-standard",
"stylelint-config-sass-guidelines",
"stylelint-config-rational-order"
],
"rules": {
"selector-class-pattern": ["[a-z]",{
"resolveNestedSelectors": true
}],
"max-nesting-depth": [2, {}]
}
}
When i run stylelint
, I get the following output :
When I then run stylelint --fix
, I have no output from styleint (like when all the warnings have been fixed). But there is no change in the files. And then when I rerun stylelint
, I get the previous errors again
Weirdly, when i had this line to the config :
{
"extends": [
"stylelint-config-standard",
"stylelint-config-sass-guidelines",
"stylelint-config-rational-order"
],
"rules": {
"order/properties-alphabetical-order": [false], // <-- This line
"selector-class-pattern": ["[a-z]",{
"resolveNestedSelectors": true
}],
"max-nesting-depth": [2, {}]
}
}
The stylelint --fix
works as expected. But then I get warnings from order/properties-alphabetical-order whereas it should be disabled by the config... Weird.
Ok, so after looking it up, it's not "[false]" to disable alphabetical-order, but "null".
So with this config :
{
"extends": [
"stylelint-config-standard",
"stylelint-config-sass-guidelines",
"stylelint-config-rational-order"
],
"rules": {
"order/properties-alphabetical-order": null,
"selector-class-pattern": ["[a-z]",{
"resolveNestedSelectors": true
}],
"max-nesting-depth": [2, {}]
}
}
The --fix is working as expected. But I don't understand why I have to add this line manually. Shouldn't the plugin do it for me ?