noDuplicateProperties
Ce contenu n’est pas encore disponible dans votre langue.
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.
Examples
Section titled ExamplesInvalid
Section titled Invalidcode-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.