Skip to content

[eslint-plugin] allow compound pseudo-classes in valid-styles - #2074

Open
kimseongyu wants to merge 1 commit into
meta:mainfrom
kimseongyu:lint-error-occurred-by-pseudo-classes-nested-child-element
Open

kimseongyu wants to merge 1 commit into
meta:mainfrom
kimseongyu:lint-error-occurred-by-pseudo-classes-nested-child-element

Conversation

@kimseongyu

Copy link
Copy Markdown
Contributor

What changed / motivation ?

Previously, the ESLint plugin only validated single pseudo-classes, so it couldn't handle compound pseudo-classes like :hover:not(:disabled) and threw a lint error.

This PR adds isPseudoClassSelector to properly parse compound pseudo-classes:

  • Parse each pseudo-class token sequentially
  • Recursively validate inner selectors when parentheses are used (e.g. :not(:disabled))

Additional changes

  • Split pseudoClasses and atRules from pseudoClassesAndAtRules
  • Clean up the branches in checkStyleProperty by prefix (::, :, @)

Follow-up

Currently, valid-styles only validates pseudo-class keys when the value is an object, not a single value like 'blue'. Extending key validation to single values can be addressed in a follow-up issue/PR.

Linked PR/Issues

Fixes #1618

Additional Context

All test is passed!

image

Screenshots, Tests, Anything Else

Pre-flight checklist

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 30, 2026
@vercel

vercel Bot commented Nov 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
stylex Ignored Ignored Nov 30, 2026 6:09am UTC

Request Review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[eslint-plugin] valid-styles rejects compound pseudo-classes like :hover:not(:disabled)

1 participant