Skip to content

noEmptySource (CSS)

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

Disallow empty sources.

A source containing only the following is considered empty:

  • Whitespace (spaces, tabs or newlines)
  • Comments
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 { }

Whether the comments should be marked as meaningful. When this option has been set to true, a file with only comments is considered valid.

Default 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 */