noShorthandPropertyOverrides
Summary
Section titled Summary- Rule available since:
v1.8.2 - Diagnostic Category:
lint/suspicious/noShorthandPropertyOverrides - This rule is recommended, which means is enabled by default.
- This rule doesn’t have a fix.
- The default severity of this rule is error.
- Sources:
Description
Section titled DescriptionDisallow shorthand properties that override related longhand properties.
For details on shorthand properties, see the MDN web docs.
Examples
Section titled ExamplesInvalid
Section titled Invalida { padding-left: 10px; padding: 20px; }code-block.css:1:25 lint/suspicious/noShorthandPropertyOverrides ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected shorthand property padding after padding-left
> 1 │ a { padding-left: 10px; padding: 20px; }
│ ^^^^^^^
2 │
Valid
Section titled Valida { padding: 10px; padding-left: 20px; }a { transition-property: opacity; } a { transition: opacity 1s linear; }How to configure
Section titled How to configure{ "linter": { "rules": { "suspicious": { "noShorthandPropertyOverrides": "error" } } }}