Skip to content

double-slash-comment-empty-line-before

Reports a // comment on a line of its own with no empty line before it. One that is first in its block, right after another comment, on the line of code, or a directive comment is not reported.

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.

With this configuration:

dollar-variable-empty-line-before: warn
custom-property-empty-line-before: warn
double-slash-comment-empty-line-before: warn
no-empty-comment: { level: warn, options: { separators: true } }
Reported
$a: 1;
$b: 2;
// note
$c: 3;
.x {
$d: 4;
...
--g: 7;
// one
// two
top: 0; // inline
...
css:
lint:
rules:
double-slash-comment-empty-line-before: warn # off (default), warn, error
less:
lint:
rules:
double-slash-comment-empty-line-before: warn # off (default), warn, error
scss:
lint:
rules:
double-slash-comment-empty-line-before: warn # off (default), warn, error

Enabled by the presets: css/stylelint-standard.

Suppress one line with sudsy-disable-next-line double-slash-comment-empty-line-before in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
stylelint-scss scss/double-slash-comment-empty-line-before full