Skip to content

noInvalidGridAreas (CSS)

Language CSS
biome.json
{
"linter": {
"rules": {
"correctness": {
"noInvalidGridAreas": "error"
}
}
}
}

Disallow invalid named areas in CSS grid templates.

Each quoted row in grid-template-areas contains space-separated cells. Every row must contain the same number of cells and must not be empty. When an area name appears in more than one cell, those cells must form one filled rectangle.

a { grid-template-areas: "a a"
"b b b"; }
code-block.css:1:26 lint/correctness/noInvalidGridAreas ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ Inconsistent cell count in grid areas are not allowed.

> 1 │ a { grid-template-areas: "a a"
│ ^^^^^
2 │ "b b b"; }
3 │

ℹ Consider adding the same number of cell tokens in each string.

a { grid-template-areas: "b b b"
""; }
code-block.css:1:33 lint/correctness/noInvalidGridAreas ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ Empty grid areas are not allowed.

> 1 │ a { grid-template-areas: "b b b"
│
> 2 │ ""; }
│ ^^
3 │

ℹ Consider adding the cell token within string.

a { grid-template-areas: "a a a"
"b b a"; }
code-block.css:1:33 lint/correctness/noInvalidGridAreas ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ Duplicate filled in rectangle are not allowed.

> 1 │ a { grid-template-areas: "a a a"
│
> 2 │ "b b a"; }
│ ^^^^^^^
3 │

ℹ Consider removing the duplicated filled-in rectangle: a

a { grid-template-areas: "a a a"
"b b b"; }
a { grid-template-areas: "a a a"
"a a a"; }