Skip to content

noShorthandPropertyOverrides

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

Disallow shorthand properties that override related longhand properties.

For details on shorthand properties, see the MDN web docs.

a { padding-left: 10px; padding: 20px; }
code-block.css:1:25 lint/suspicious/noShorthandPropertyOverrides ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This shorthand property padding overrides the earlier padding-left declaration.

> 1 │ a { padding-left: 10px; padding: 20px; }
^^^^^^^
2 │

Shorthand properties reset related longhand properties, which can overwrite earlier values unexpectedly.

Declare the shorthand first, or use longhand properties consistently so later declarations stay explicit.

a { padding: 10px; padding-left: 20px; }
a { transition-property: opacity; } a { transition: opacity 1s linear; }