[eslint-plugin] Add gap/gridGap shorthand expansion to stylex-valid-shorthands#1552
Merged
[eslint-plugin] Add gap/gridGap shorthand expansion to stylex-valid-shorthands#1552
Conversation
…horthands Always expand gap to rowGap + columnGap (even single values), since gap is banned by stylex-valid-styles propLimits on all surfaces. gridGap expands identically. gridColumnGap and gridRowGap are simple legacy renames to columnGap and rowGap respectively.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
workflow: benchmarks/sizeComparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
|
workflow: benchmarks/perfComparison of performance test results, measured in operations per second. Larger is better.
|
mellyeliu
approved these changes
Mar 31, 2026
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
gapandgridGapshorthands intorowGap+columnGaplonghands. Single-valuegapis always expanded (not passed through) becausegapis banned bystylex-valid-stylespropLimitson all surfaces. Also addsgridColumnGap→columnGapandgridRowGap→rowGapas legacy name renames.
What changed / motivation ?
gapis banned bystylex-valid-styleson all Meta surfaces. Without an autofix instylex-valid-shorthands, users see an error fromvalid-styleswith no automated path to fix it.This PR ensures
gap(even single-value) always expands torowGap+columnGap.gap: '10px'→rowGap: '10px'+columnGap: '10px'gap: '10px 20px'→rowGap: '10px'+columnGap: '20px'gridGap→ same expansion asgapgridColumnGap→columnGap(legacy rename)gridRowGap→rowGap(legacy rename)Linked PR/Issues
Follow-up to #1477
Additional Context
Added tests covering: single values, numeric values, calc(), var(), !important,
comma/slash/3-value CANNOT_FIX edge cases.
Pre-flight checklist
Contribution Guidelines