[eslint-plugin] Add logical border shorthand expansion to stylex-valid-shorthands#1585
Open
[eslint-plugin] Add logical border shorthand expansion to stylex-valid-shorthands#1585
Conversation
…d-shorthands Expand logical border shorthands into their longhand equivalents. These properties currently hard-error in stylex-valid-styles via showError with no autofix path. Tier 1 — 3-part border expansion (width/style/color): borderInlineEnd, borderInlineStart, borderBlockEnd, borderBlockStart, borderInline, borderBlock Tier 2 — 2-value sub-shorthand expansion (start/end): borderInlineColor, borderInlineStyle, borderInlineWidth, borderBlockColor, borderBlockStyle, borderBlockWidth
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
workflow: benchmarks/perfComparison of performance test results, measured in operations per second. Larger is better.
|
workflow: benchmarks/sizeComparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expand logical border shorthands (
borderInlineEnd,borderBlockStart,borderInline,borderBlockColor, etc.) into their longhand equivalents. Reuses the existingexpandBorderSideShorthandandparseBorderPartshelpers for 3-part border-side shorthands,and adds a new handler for 2-value border-axis shorthands.
Stack: 1/7
What changed / motivation ?
The rule already handled
borderTop/Right/Bottom/Leftbut was missing the logical(inline/block) variants.
Border-side shorthands (3-part width/style/color expansion):
borderInlineEnd: '1px solid red'→borderInlineEndWidth+borderInlineEndStyle+borderInlineEndColorborderInlineStart,borderBlockEnd,borderBlockStart,borderInline,borderBlockBorder-axis shorthands (2-value start/end expansion):
borderInlineColor: 'red blue'→borderInlineStartColor+borderInlineEndColorborderInlineStyle/Width,borderBlockColor/Style/WidthSingle values pass through unchanged. Incomplete borders (e.g. missing color) return CANNOT_FIX.
Linked PR/Issues
Follow-up to #1553
Additional Context
Added tests covering: 3-part border expansion, 2-value axis expansion, rgba() colors,
!important propagation, incomplete borders (CANNOT_FIX), single-value passthrough.
Pre-flight checklist
Contribution Guidelines