Skip to content

[eslint-plugin] accept numeric values for grid line properties#1730

Open
ahmedsadid wants to merge 1 commit into
facebook:mainfrom
ahmedsadid:issue-1701
Open

[eslint-plugin] accept numeric values for grid line properties#1730
ahmedsadid wants to merge 1 commit into
facebook:mainfrom
ahmedsadid:issue-1701

Conversation

@ahmedsadid

Copy link
Copy Markdown
Contributor

What changed / motivation ?

The stylex-valid-styles rule rejected numeric literals for grid line properties, even though they are valid CSS. Writing gridColumnStart: 1 triggered a lint error:

gridColumnStart value must be one of: auto, a string literal, null, initial, inherit, unset, revert

This happened because the shared gridLine rule in cssProperties.js only permitted auto and string values, not numbers.

This change adds isNumber to the gridLine rule. Because all six grid line properties — gridColumn, gridColumnStart, gridColumnEnd, gridRow, gridRowStart, gridRowEnd (and gridArea) — derive from gridLine, the single change fixes them all. This mirrors the existing zIndex rule, which already uses makeUnionRule(makeLiteralRule('auto'), isNumber), and follows the precedent set in #1522 / #1523 for accepting bare numbers.

Linked PR/Issues

Fixes #1701

Additional Context

Added valid test cases covering numeric values for all affected properties, including a negative integer (gridRowStart: -1), which is valid for grid lines. Full plugin suite passes (548 tests).

Pre-flight checklist

  • I have read the contributing guidelines
  • Performed a self-review of my code

@ahmedsadid ahmedsadid requested review from mellyeliu and nmn as code owners June 22, 2026 07:07
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 22, 2026
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
stylex Skipped Skipped Jun 22, 2026 7:07am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@stylexjs/valid-styles: gridColumn / gridRow must be a stringified number

1 participant