Disallow nesting a single block if it could be merged with its parent block.
.foo {
.bar {}
}
Sass official docs on nested properties.
The following patterns are considered warnings:
.foo {
.bar {}
}
.foo {
&-bar {
&-baz {
color: red;
}
}
}
The following patterns are not considered warnings:
.foo .bar {}
.foo-bar-baz {
color: red;
}
// multiple child blocks
.foo {
.bar {}
&-baz {}
}
// parent or child with selector list
.foo {
.bar, .baz {}
}
.foo, .bar {
&-baz {}
}