Skip to content

[eslint-plugin] Accept math functions, percentages and keywords for textDecorationThickness - #1975

Open
rodrigosdev wants to merge 2 commits into
meta:mainfrom
rodrigosdev:fix/252-text-decoration-thickness
Open

rodrigosdev wants to merge 2 commits into
meta:mainfrom
rodrigosdev:fix/252-text-decoration-thickness

Conversation

@rodrigosdev

Copy link
Copy Markdown

What changed / motivation ?

valid-styles rejects valid textDecorationThickness values such as auto, from-font, 10%, calc(1px + 0.1em) and max(3px, 0.1875rem, 0.12em). The rule was makeUnionRule(isNumber, isLength), which only accepts numbers and plain length strings.

This adds isNonNumericString to the union, the same fix #1760 applied to outlineWidth (and what borderWidth already uses). Unitless numeric strings like '10' are still reported.

Linked PR/Issues

Fixes #252

Additional Context

Added a valid test case covering the keywords, a percentage, calc(), and max() inside a :hover condition from the issue. Added textDecorationThickness: "10" to the existing numeric-string invalid case.

Pre-flight checklist

🤖 Generated with Claude Code

…extDecorationThickness

`valid-styles` checked `textDecorationThickness` with only `isNumber` and
`isLength`, so valid values like `auto`, `from-font`, `10%`, `calc(...)` and
`max(...)` were reported as errors. Add `isNonNumericString` to the union,
matching `outlineWidth` (meta#1760) and `borderWidth`. Numeric strings like `'10'`
are still rejected.

Fixes meta#252

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

meta-cla Bot commented Oct 21, 2026

Copy link
Copy Markdown

Hi @rodrigosdev!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@vercel

vercel Bot commented Oct 21, 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 23, 2026 7:09pm 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 21, 2026
@meta-cla

meta-cla Bot commented Oct 21, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

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] textDecorationThickness error reported

1 participant