noEmptyBlock
Diagnostic Category: lint/suspicious/noEmptyBlock
Since: v1.8.0
Sources:
- Same as:
stylelint/block-no-empty
Disallow CSS empty blocks.
By default, it will allow empty blocks with comments inside.
Examples
Section titled ExamplesInvalid
Section titled Invalidcode-block.css:1:3 lint/suspicious/noEmptyBlock ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ An empty block isn’t allowed.
> 1 │ p {}
│ ^^
2 │
ℹ Consider removing the empty block or adding styles inside it.
code-block.css:1:4 lint/suspicious/noEmptyBlock ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ An empty block isn’t allowed.
> 1 │ .b {}
│ ^^
2 │
ℹ Consider removing the empty block or adding styles inside it.
code-block.css:1:18 lint/suspicious/noEmptyBlock ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ An empty block isn’t allowed.
> 1 │ @media print { a {} }
│ ^^
2 │
ℹ Consider removing the empty block or adding styles inside it.