stylelint-config-rational-order
stylelint-config-rational-order copied to clipboard
rule conflict with `stylelint-config-standard`
trafficstars
stylelint.config.js file like this:
module.exports = {
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
plugins: ['stylelint-order', 'stylelint-config-rational-order/plugin'],
rules: {
// `standard` conflict with `rational-order`
'declaration-empty-line-before': [
'never',
{
except: ['after-comment', 'after-declaration', 'first-nested'],
ignore: [
'after-comment',
'after-declaration',
'first-nested',
'inside-single-line-block',
],
},
],
'order/properties-order': [],
'plugin/rational-order': [
true,
{
'border-in-box-model': false,
'empty-line-between-groups': true,
},
],
},
};
When I using declaration-empty-line-before with empty-line-between-groups: true, one of the two rules not work.
So, If I only hope empty-line-between-groups: true rule works, how to configure it?
I don't know if this is the correct/best way to do it, but it's at least a workaround. Here's a sample .stylelintrc which "fixes" the problem:
{
"extends": [
"stylelint-config-standard",
"stylelint-config-rational-order",
"stylelint-config-css-modules"
],
"rules": {
"declaration-empty-line-before": null, //<----------------------------------
"indentation": 4,
"order/properties-order": [],
"plugin/rational-order": [
true,
{
"empty-line-between-groups": true
}
]
}
}
I don't know if this is the correct/best way to do it, but it's at least a workaround. Here's a sample
.stylelintrcwhich "fixes" the problem:{ "extends": [ "stylelint-config-standard", "stylelint-config-rational-order", "stylelint-config-css-modules" ], "rules": { "declaration-empty-line-before": null, //<---------------------------------- "indentation": 4, "order/properties-order": [], "plugin/rational-order": [ true, { "empty-line-between-groups": true } ] } }
Thank you, it's worked.