[eslint-plugin] Add border shorthand expansion to stylex-valid-shorthands#1553
Merged
[eslint-plugin] Add border shorthand expansion to stylex-valid-shorthands#1553
Conversation
|
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.
|
nmn
approved these changes
Apr 1, 2026
…ands Expand border: '<width> <style> <color>' into borderWidth, borderStyle, and borderColor longhands. Reuses the existing expandBorderSideShorthand and parseBorderParts helpers. Incomplete borders (e.g. missing color) report an error without autofix. Also adds borderStart → borderInlineStart and borderEnd → borderInlineEnd legacy renames.
f90663f to
b3b8173
Compare
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
border: '<width> <style> <color>'intoborderWidth,borderStyle, andborderColorlonghands. Reuses the existing
expandBorderSideShorthandandparseBorderPartshelpers.Also adds
borderStart→borderInlineStartandborderEnd→borderInlineEndas legacyname renames.
What changed / motivation ?
The rule already handled
borderTop,borderRight,borderBottom,borderLeftbut was missingthe base
bordershorthand. Incomplete borders (e.g.border: '1px solid'with missing color)correctly report an error without autofix (CANNOT_FIX).
border: '1px solid red'→borderWidth: '1px'+borderStyle: 'solid'+borderColor: 'red'border: 'none'→ passes through (single value, no expansion needed)border: '1px solid'→ error, no autofix (missing color)borderStart→borderInlineStart(legacy rename)borderEnd→borderInlineEnd(legacy rename)Linked PR/Issues
Follow-up to #1477
Additional Context
Added tests covering: full 3-part expansion, rgba() colors, !important propagation,
incomplete borders (CANNOT_FIX), single-value passthrough, separate legacy rename tests.
Pre-flight checklist
Contribution Guidelines