rule-empty-line-before
What it does
Section titled “What it does”Reports a rule whose block spans several lines and has no empty line before it. A rule that is first in its block, and one right after a comment, need none.
Why it matters
Section titled “Why it matters”An empty line between rules shows where one rule ends and the next starts, and keeps a long file scannable. A rule that opens a block has nothing to be separated from, and a comment belongs to the rule below it.
Example
Section titled “Example”...
c { color: red; top: 0; }d { color: red; top: 0; }/* comment */e { color: red; }... /* c */ right: 0; g { x: y } h { x: y;...x { --a: 1; --b: 2;
--c: 3;...y {...}Configuration
Section titled “Configuration”css: lint: rules: rule-empty-line-before: warn # off (default), warn, errorless: lint: rules: rule-empty-line-before: warn # off (default), warn, errorscss: lint: rules: rule-empty-line-before: warn # off (default), warn, errorEnabled by the presets: css/stylelint-standard.
Suppress one line with sudsy-disable-next-line rule-empty-line-before 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 | rule-empty-line-before |
full |