Is there any way at all to accomplish this now?
I see rule-nested-empty-line-before has been removed for some reason, so is this config no longer possible?
I want this to throw errors...
@media (max-width: 300px) {
.foo {
display: block;
}
}
@media (max-width: 600px) {
.bar {
display: block;
}
}
There should be a space before @media since it's not nested, and no space before .foo since it's nested.
The
rule-nested-empty-line-before
andrule-non-nested-empty-line-before
rules were combined together to form the newrule-empty-line-before
rule in version8.0.0
. You can use this rule to control the empty lines before the.foo {}
and.bar {}
rules.@media
is an at-rule, so you should use theat-rule-empty-line-before
rule to control the empty lines before it.You can learn about how rules are named and how they work together in this section of the User Guide.
With the above in mind, the configuration for that should be:
Alternatively, you can use
stylelint-standard-config
, which has sensible defaults for stylistic rules.