New Rule: `no-shorthand-property-overrides` · Issue #495 · eslint/css · GitHub
Skip to content

New Rule: no-shorthand-property-overrides #495

Open

Description

@przemyslaw-zan

Rule details

Disallow shorthand properties that override related longhand properties.

What type of rule is this?

Warns about a potential problem

Example code

a {
  padding-left: 10px;
  padding: 20px;
}

a {
  background-repeat: no-repeat;
  background: url(image.png); /* silently resets background-repeat to its initial value */
}

Prior Art

Participation

  • I am willing to submit a pull request to implement this rule.

AI acknowledgment

  • I did not use AI to generate this issue report.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

Additional comments

  • Detection would be purely name-based, a shorthand always resets all its longhands regardless of their value, so the rule needs no value parsing, just a map which is available in @webref/css.

Activity

  1. DMartens commented on Jul 10, 2026

    @DMartens
    Contributor

    I agree that this rule would be helpful and matches the inclusion criteria.
    We would not use @webref/css directly but the data available in the sourceCode.lexer.

  2. moved this from Needs Triage to Feedback Needed in Triageon Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

  • Status
    Feedback Needed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions