Skip to content

noDuplicateProperties

Diagnostic Category: lint/nursery/noDuplicateProperties

Since: v1.9.4

Sources:

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/nursery/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;
}