Repository navigation
[eslint-plugin] Accept math functions, percentages and keywords for textDecorationThickness - #1975
rodrigosdev wants to merge 2 commits into
Conversation
…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>
|
Hi @rodrigosdev! Thank you for your pull request and welcome to our community. Action RequiredIn 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. ProcessIn 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 If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
What changed / motivation ?
valid-stylesrejects validtextDecorationThicknessvalues such asauto,from-font,10%,calc(1px + 0.1em)andmax(3px, 0.1875rem, 0.12em). The rule wasmakeUnionRule(isNumber, isLength), which only accepts numbers and plain length strings.This adds
isNonNumericStringto the union, the same fix #1760 applied tooutlineWidth(and whatborderWidthalready 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(), andmax()inside a:hovercondition from the issue. AddedtextDecorationThickness: "10"to the existing numeric-string invalid case.Pre-flight checklist
Contribution Guidelines
🤖 Generated with Claude Code