Skip to content

Conversation

@TKDev7
Copy link
Contributor

@TKDev7 TKDev7 commented Oct 14, 2025

Prerequisites checklist

What is the purpose of this pull request?

This PR introduces a new rule no-unmatchable-selectors to catch CSS selectors that can never match any elements, helping developers identify dead code and potential mistakes in their stylesheets.

What changes did you make? (Give an overview)

  • Implemented no-unmatchable-selectors rule that detects and reports selectors with impossible :nth-*() pseudo-class formulas
  • Added rule documentation
  • Included test cases covering both invalid patterns and valid patterns

Related Issues

#186

This initial implementation focuses on :nth-*() pseudo-classes, but I plan to expand the rule in follow-up PRs to cover additional scenarios.

Is there anything you'd like reviewers to focus on?

@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Oct 14, 2025
@nzakas nzakas moved this from Needs Triage to Implementing in Triage Oct 21, 2025
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking really good. Just a couple of notes around documentation.

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@nzakas nzakas merged commit adaa397 into eslint:main Oct 27, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from Implementing to Complete in Triage Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

2 participants