no-empty-comment
What it does
Section titled “What it does”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.
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”{ /**/ "b": 2}Configuration
Section titled “Configuration”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.
Upstream equivalents
Section titled “Upstream equivalents”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 |