Skip to content

[eslint-plugin] Allow stylex token arguments in firstThatWorks - #1996

Open
henryqdineen wants to merge 1 commit into
meta:mainfrom
henryqdineen:hqd-pr-1620-ftw-token-args
Open

henryqdineen wants to merge 1 commit into
meta:mainfrom
henryqdineen:hqd-pr-1620-ftw-token-args

Conversation

@henryqdineen

@henryqdineen henryqdineen commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

What changed / motivation ?

#1620 validates each firstThatWorks argument, but the existing exemption for imported .stylex tokens only applied to the whole property value. So opacity: stylex.firstThatWorks(tokens.button.opacity, '1') started failing valid-styles.

This skips token arguments inside firstThatWorks using the existing isStylexResolvedVarsToken helper. All other arguments are still validated.

Linked PR/Issues

Follow-up to #1620

Additional Context

Tests added:

  • valid: token argument with a valid fallback
  • invalid: token argument with an invalid fallback still errors

Pre-flight checklist

🤖 Generated with Claude Code

Validating each firstThatWorks argument bypassed the existing exemption
for imported .stylex token references, which only applied to the whole
property value. Common patterns like
`firstThatWorks(tokens.button.opacity, '1')` started failing
valid-styles. Skip recognized token arguments and keep validating the
rest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 27, 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 Oct 27, 2026 4:02am UTC

Request Review

@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 Oct 27, 2026
@henryqdineen henryqdineen changed the title [eslint-plugin] Follow-up to #1620: allow stylex token arguments in firstThatWorks [eslint-plugin] Followup to #1620: allow stylex token arguments in firstThatWorks Oct 27, 2026
@henryqdineen henryqdineen changed the title [eslint-plugin] Followup to #1620: allow stylex token arguments in firstThatWorks [eslint-plugin] Allow stylex token arguments in firstThatWorks Oct 27, 2026

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.

1 participant