Skip to content

no-empty-comment

Reports a comment with no text. An empty block comment (/**/) is reported wherever it is. An empty line comment is reported only when it begins or ends a run of comment lines, because a bare // between two comment lines separates paragraphs; the option separators reports those too.

An empty comment says nothing: it is a leftover of a deleted comment or of an unfinished one, and a reader stops to look for the meaning that is not there.

To fix, write the text or delete the comment.

Reported
{
/**/
"b": 2
}
lint:
rules:
no-empty-comment:
level: warn # off (default), warn, error
options:
separators: false
Option Type Default Description
separators bool false Also report an empty line comment between two comments.

Enabled by the presets: css/stylelint-recommended, css/stylelint-standard, csharp/stylecop.

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

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

Tool Rule Match
StyleCop SA1120 full
stylelint comment-no-empty full
stylelint-scss scss/comment-no-empty full