Skip to content

noIrregularWhitespace (CSS)

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

Disallow whitespace characters that CSS does not treat as normal spaces.

Some Unicode and control characters look like spaces but can change how a selector is parsed. The invalid example contains a vertical tab between the class selectors, so it does not behave like a normal descendant separator.

.firstClass .secondClass {
color: red;
}
code-block.css:1:12 lint/suspicious/noIrregularWhitespace ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠ Irregular whitespace found.

> 1 │ .firstClass␋.secondClass {
│ ^
2 │ color: red;
3 │ }

ℹ Replace the irregular whitespace with normal whitespaces.

.firstClass .secondClass {
color: red;
}