noDuplicateProperties
Diagnostic Category: lint/nursery/noDuplicateProperties
Since: v1.9.4
Sources:
Description
Section titled DescriptionDisallow duplicate properties within declaration blocks.
This rule checks the declaration blocks for duplicate properties. It ignores custom properties.
Examples
Section titled ExamplesInvalid
Section titled Invalida { 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.
Valid
Section titled Valida { color: pink; background: orange;}
How to configure
Section titled How to configure{ "linter": { "rules": { "nursery": { "noDuplicateProperties": "error" } } }}