Aller au contenu

noDuplicateProperties

Ce contenu n’est pas encore disponible dans votre langue.

Disallow duplicate properties within declaration blocks.

This rule checks the declaration blocks for duplicate properties. It ignores custom properties.

a {
color: pink;
color: orange;
}
code-block.css:3:3 lint/suspicious/noDuplicateProperties ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Duplicate properties can lead to unexpected behavior and may override previous declarations unintentionally.

1 │ a {
2 │ color: pink;
> 3 │ color: orange;
^^^^^
4 │ }
5 │

color is already defined here.

1 │ a {
> 2 │ color: pink;
^^^^^
3 │ color: orange;
4 │ }

Remove or rename the duplicate property to ensure consistent styling.

a {
color: pink;
background: orange;
}
biome.json
{
"linter": {
"rules": {
"suspicious": {
"noDuplicateProperties": "error"
}
}
}
}