Rule Change: Allow no-empty-blocks to ignore comment-only blocks
@Pixel998 is already working on this.
Since Jun 24, 2026.
Assessment
This issue has not been assessed yet.
Description
What rule do you want to change?
no-empty-blocks
What change do you want to make?
Generate fewer warnings
How do you think the change should be implemented?
A new option
Example code
@media (min-width: 1200px) {
.sidebar { /* Fix this later */ }
}
What does the rule currently do for this code?
The rule reports the block as empty.
The rule currently treats comments as not being content, so a block containing only a comment is reported. There is no option to change this behavior.
What will the rule do after it's changed?
With a new option, users could choose for comment-only blocks to be treated as non-empty, so the example above would not be reported.
Participation
- I am willing to submit a pull request to implement this change.
AI acknowledgment
- I did not use AI to generate this issue report.
- (If the above is not checked) I have reviewed the AI-generated content before submitting.
Additional comments
This would bring no-empty-blocks closer to Stylelint’s block-no-empty, which does not report comment-only blocks by default: https://stylelint.io/user-guide/rules/block-no-empty/
- Dominant language
- JavaScript
- Stars
- 308
- Forks
- 44
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 18
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eslint/css
-
accepted enhancement
-
enhancement
-
feature
-
feature
-
feature
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·