block-no-empty
CSS / SCSS / LessCSS / SCSS / LessCSS / SCSS / Lesssuspiciousno fixdefault: offcss/stylelint-recommended
What it does
Section titled “What it does”Reports a rule or at-rule block with nothing in it, comments included.
Why it matters
Section titled “Why it matters”An empty block does nothing. It is a leftover of a deleted declaration or a placeholder that was never filled, and it adds bytes and noise to the file.
To fix, delete the rule, or put the declarations in it.
Example
Section titled “Example”a {}b { }c { /* kept */ }@media print {}d { color: red }Configuration
Section titled “Configuration”css: lint: rules: block-no-empty: warn # off (default), warn, errorless: lint: rules: block-no-empty: warn # off (default), warn, errorscss: lint: rules: block-no-empty: warn # off (default), warn, errorEnabled by the presets: css/stylelint-recommended.
Suppress one line with sudsy-disable-next-line block-no-empty in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| stylelint | block-no-empty |
full |