comment-empty-line-before
What it does
Section titled “What it does”Reports a /* */ comment on a line of its own with no empty line before it. One that is first in its block, on the line of code, or a directive comment is not reported. A // comment is another rule’s.
Why it matters
Section titled “Why it matters”A comment describes what follows, and an empty line before it ties it to the next rule rather than to the end of the previous one.
Example
Section titled “Example”/* first */a { color: red; }/* needs a line */
/* has one */b { /* first in the block */ color: red; /* needs a line */
/* has one */ top: 0; /* same line */...Configuration
Section titled “Configuration”css: lint: rules: comment-empty-line-before: warn # off (default), warn, errorless: lint: rules: comment-empty-line-before: warn # off (default), warn, errorscss: lint: rules: comment-empty-line-before: warn # off (default), warn, errorEnabled by the presets: css/stylelint-standard.
Suppress one line with sudsy-disable-next-line comment-empty-line-before in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.
| Tool | Rule | Match | What differs |
|---|---|---|---|
| stylelint | comment-empty-line-before |
partial | // comments are left to double-slash-comment-empty-line-before, as stylelint ignores them |