Skip to content

no-invalid-double-slash-comments

Reports a rule or declaration that starts with //.

CSS has no line comments. The browser reads // note as part of the next statement, so the selector or the property name is wrong and the rule or declaration is dropped. The comment seems to work and breaks the line below it.

To fix, write the comment as /* note */. Sass and Less read // as a comment, so there it is not reported.

Reported
a { color: red }
// note
b { color: blue }
css:
lint:
rules:
no-invalid-double-slash-comments: warn # off, warn (default), error
less:
lint:
rules:
no-invalid-double-slash-comments: warn # off, warn (default), error
scss:
lint:
rules:
no-invalid-double-slash-comments: warn # off, warn (default), error

Enabled by the presets: css/stylelint-recommended.

Suppress one line with sudsy-disable-next-line no-invalid-double-slash-comments 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 no-invalid-double-slash-comments full