Skip to content

New Rule: no-invalid-named-grid-areas #158

@xbinaryx

Description

@xbinaryx
Contributor

Rule details

Disallow invalid named grid areas.

What type of rule is this?

Warns about a potential problem

Example code

a { grid-template-areas: "a a a"
                         "b b b b"; }

Prior Art

named-grid-areas-no-invalid from stylelint

Participation

  • I am willing to submit a pull request to implement this rule.

Additional comments

For a named grid area to be valid, all strings must define:

  • the same number of cell tokens
  • at least one cell token

And all named grid areas that spans multiple grid cells must form a single filled-in rectangle.

Activity

nzakas

nzakas commented on Jun 2, 2025

@nzakas
Member

Just to double-check, this isn't already caught by no-invalid-properties, correct?

moved this from Needs Triage to Triaging in Triageon Jun 2, 2025
xbinaryx

xbinaryx commented on Jun 3, 2025

@xbinaryx
ContributorAuthor

That's correct, it's not.

moved this from Triaging to Ready to Implement in Triageon Jun 3, 2025
added
acceptedThere is consensus among the team that this change meets the criteria for inclusion
on Jun 3, 2025
nzakas

nzakas commented on Jun 3, 2025

@nzakas
Member

Tentatively marked as accepted. Can you take a look and see if there's any other grid-specific validation that this rule can do? I'm generally not a fan of rules that are laser-focused on just one thing, so if there's anything else that can be added, I'd be interested in hearing about it.

xbinaryx

xbinaryx commented on Jun 9, 2025

@xbinaryx
ContributorAuthor

I've reviewed the rule again and explored existing Stylelint rules, but I haven't been able to identify any other grid-specific validations that could be incorporated into this rule.

moved this from Ready to Implement to Implementing in Triageon Jun 10, 2025
moved this from Implementing to Complete in Triageon Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionfeature

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @nzakas@xbinaryx

    Issue actions

      New Rule: no-invalid-named-grid-areas · Issue #158 · eslint/css