noEmptyBlock
诊断类别:lint/suspicious/noEmptyBlock
¥Diagnostic Category: lint/suspicious/noEmptyBlock
自从:v1.8.0
¥Since: v1.8.0
来源:
¥Sources:
-
与以下相同:
stylelint/block-no-empty
¥Same as:
stylelint/block-no-empty
禁止 CSS 空块。
¥Disallow CSS empty blocks.
默认情况下,它将允许带有注释的空块。
¥By default, it will allow empty blocks with comments inside.
¥Examples
¥Invalid
code-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.
¥Valid
¥Related links