# No empty rules Disallow empty rules and at-rules (including those containing only comments). ```css 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. ## Options ### `true` The following are considered problems: ```css a {} ``` ```css a { /* comment */ } ``` ```css @media screen {} ``` ```css @media screen { /* comment */ } ``` ```css a { &:hover {} } ``` The following patterns are _not_ considered problems: ```css a { color: red; } ``` ```css @media screen { a { color: red; } } ``` ```css a { &:hover { color: red; } } ``` ```css @charset "UTF-8"; ``` ## Secondary options ### `allow: Array<"rules" | "atrules" | "comments">` #### `"rules"` Allow empty regular CSS rules (selector blocks). The following is _not_ considered a problem: ```css /* "rules" */ a {} ``` #### `"atrules"` Allow empty at-rules (at-rule blocks with no content). The following is _not_ considered a problem: ```css /* "atrules" */ @media screen {} ``` #### `"comments"` Allow rules and at-rules whose only content is comments. The following are _not_ considered problems: ```css /* "comments" */ a { /* comment */ } ``` ```css /* "comments" */ @media screen { /* comment */ } ``` ## Prior art - stylelint's [`block-no-empty`](https://stylelint.io/user-guide/rules/block-no-empty) rule