Skip to content

New Rule: no-unmatchable-anb-selector #186

Open
@TKDev7

Description

@TKDev7

Rule details

Disallow unmatchable An+B selectors.

What type of rule is this?

Warns about a potential problem

Example code

a:nth-child(0n+0) {}
/*↑             ↑
 * This unmatchable An+B selector */

Prior Art

selector-anb-no-unmatchable: https://stylelint.io/user-guide/rules/selector-anb-no-unmatchable/

Participation

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

Additional comments

An+B selectors are one-indexed. Selectors that always evaluate to 0 will not match any elements.

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

Status

Ready to Implement

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions