Open
Description
Hello!
I have the following config and dependencies:
"stylelint": "^13.6.1"
"stylelint-order": "^4.1.0",
"stylelint-scss": "^3.18.0"
module.exports = {
plugins: ['stylelint-scss', 'stylelint-order'],
rules: {
'order/order': [
[
'custom-properties',
'at-variables',
'dollar-variables',
{
type: 'at-rule',
name: 'include',
hasBlock: false
},
'declarations',
'rules',
{
type: 'at-rule',
name: 'include',
hasBlock: true
}
]
],
'order/properties-order': [
[
{
emptyLineBefore: 'always',
noEmptyLineBetween: true,
properties: ['z-index', 'display']
},
{
emptyLineBefore: 'always',
noEmptyLineBetween: true,
properties: ['font-weight', 'text-align']
}
],
{
unspecified: 'bottom',
emptyLineBeforeUnspecified: 'always'
}
],
'comment-empty-line-before': [
'always',
{
except: ['first-nested'],
ignore: ['stylelint-commands']
}
],
'custom-property-empty-line-before': [
'always',
{
except: ['after-custom-property', 'first-nested'],
ignore: ['after-comment', 'inside-single-line-block']
}
],
'rule-empty-line-before': [
'always',
{
except: ['first-nested', 'after-rule'],
ignore: ['after-comment']
}
],
'at-rule-empty-line-before': [
'always',
{
except: ['after-same-name', 'first-nested'],
ignore: ['after-comment']
}
]
}
};
and index.scss
:
.test {
display: block;
text-align: left;
@media screen {
//
}
span {
color: red;
}
/* comment1 */
@include with-block() {
// ...
}
font-weight: bold;
z-index: 1;
/* comment3 */
@include no-block();
}
after lint with autofix I expect:
.test {
/* comment3 */
@include no-block();
z-index: 1;
display: block;
font-weight: bold;
text-align: left;
span {
color: red;
}
/* comment1 */
@include with-block() {
// ...
}
@media screen {
//
}
}
but get (no empty line after @include no-block();
):
.test {
/* comment3 */
@include no-block();
z-index: 1;
display: block;
font-weight: bold;
text-align: left;
span {
color: red;
}
/* comment1 */
@include with-block() {
// ...
}
@media screen {
//
}
}
if I add
'declaration-empty-line-before': ['always', {
except: ['first-nested', 'after-comment', 'after-declaration'],
}]
the result will be (no empty line between declarations groups):
.test {
/* comment3 */
@include no-block();
z-index: 1;
display: block;
font-weight: bold;
text-align: left;
span {
color: red;
}
/* comment1 */
@include with-block() {
// ...
}
@media screen {
//
}
}
Is the problem in my configuration or it's problem in stylelint-order
?
Metadata
Assignees
Labels
No labels
Activity