Disallow empty rules and at-rules (including those containing only comments).
a {
/* ^ */
}Empty rules add noise to stylesheets without affecting styling. Rules that contain only comments provide no declarations and should be removed or filled with actual styles.
The following are considered problems:
a {}a { /* comment */ }@media screen {}@media screen { /* comment */ }a { &:hover {} }The following patterns are not considered problems:
a { color: red; }@media screen { a { color: red; } }a { &:hover { color: red; } }@charset "UTF-8";Allow empty regular CSS rules (selector blocks).
The following is not considered a problem:
/* "rules" */
a {}Allow empty at-rules (at-rule blocks with no content).
The following is not considered a problem:
/* "atrules" */
@media screen {}Allow rules and at-rules whose only content is comments.
The following are not considered problems:
/* "comments" */
a { /* comment */ }/* "comments" */
@media screen { /* comment */ }- stylelint's
block-no-emptyrule