[eslint-plugin] Add gap auto-fix for legacy-expand-shorthands and skip single-value gap in valid-shorthands - #1668
Merged
Merged
Conversation
…p single-value gap in valid-shorthands - Add `gap` to `shorthandExpansionMap` in valid-styles so the auto-fixer can expand `gap` to `rowGap`/`columnGap` when `legacy-expand-shorthands` or `banPropsForLegacy` is active. - In valid-shorthands, skip reporting single-value `gap` (e.g. `gap: 10px`) since it is a valid CSS property, not a multi-value shorthand. Multi-value `gap` (e.g. `gap: 10px 20px`) still expands to `rowGap`/`columnGap`. - `gridGap` single-value expansion is unchanged — it still expands since `gridGap` is a deprecated property name.
|
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.
|
mellyeliu
approved these changes
May 15, 2026
2 tasks
2 tasks
This branch was previously deployed
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.
What changed / motivation ?
Two changes to the eslint-plugin's
gaphandling:Add
gaptoshorthandExpansionMapinvalid-styles— enables the auto-fixer to expandgaptorowGap/columnGapwhenstyleResolution: 'legacy-expand-shorthands'orbanPropsForLegacyis active. No impact on users who don't opt into legacy mode — the auto-fix path is already gated behindisLegacyExpandShorthands.Skip single-value
gapinvalid-shorthands—gap: 10pxis a valid CSS property, not a multi-value shorthand. Previously, the rule would flag it and expand torowGap: 10px+columnGap: 10px, which is unnecessary. Multi-valuegap(e.g.,gap: 10px 20px) still correctly expands.gridGapsingle-value expansion is unchanged sincegridGapis a deprecated property name.Linked PR/Issues
n/a
Additional Context
All 546 eslint-plugin tests pass. 5 single-value
gaptest cases moved frominvalidtovalidin thevalid-shorthandstest suite.Pre-flight checklist
Contribution Guidelines