跳转到内容

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