Skip to content

noEmptySource (CSS)

biome.json
{
"linter": {
"rules": {
"suspicious": {
"noEmptySource": "error"
}
}
}
}

Disallow empty sources.

A file is empty when it contains no CSS rules or declarations. By default, whitespace and comments do not count as content.

code-block.css:2:1 lint/suspicious/noEmptySource ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠ An empty source is not allowed.

> 2 │
│

ℹ Empty sources can clutter the codebase and increase cognitive load; deleting empty sources can help reduce it.

/* Only comments */
code-block.css:2:1 lint/suspicious/noEmptySource ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠ An empty source is not allowed.

1 │ /* Only comments */
> 2 │
│

ℹ Empty sources can clutter the codebase and increase cognitive load; deleting empty sources can help reduce it.

a { }

Treats comments as meaningful content when set to true, so a comments-only file is valid. An entirely empty file remains invalid. Defaults to false.

biome.json
{
"linter": {
"rules": {
"suspicious": {
"noEmptySource": {
"level": "on",
"options": {
"allowComments": true
}
}
}
}
}
}
code-block.css:2:1 lint/suspicious/noEmptySource ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠ An empty source is not allowed.

> 2 │
│

ℹ Empty sources can clutter the codebase and increase cognitive load; deleting empty sources can help reduce it.

/* Only comments */