Skip to content

JS-1838 Add selector-anb-no-unmatchable CSS rule#7204

Draft
erwan-leforestier-sonarsource wants to merge 1 commit into
masterfrom
feat/js-1838-add-selector-anb-no-unmatchable
Draft

JS-1838 Add selector-anb-no-unmatchable CSS rule#7204
erwan-leforestier-sonarsource wants to merge 1 commit into
masterfrom
feat/js-1838-add-selector-anb-no-unmatchable

Conversation

@erwan-leforestier-sonarsource
Copy link
Copy Markdown
Contributor

Summary

Add the CSS stylelint-backed rule that reports unmatchable An+B selectors such as :nth-child(0).
RSPEC PR: https://github.com/SonarSource/rspec/pull/7032

Changes

  • Map S8764 to selector-anb-no-unmatchable
  • Add CSS analyzer tests for compliant and noncompliant selector formulas
  • Sync the generated CSS rule metadata and Sonar way profile resources

Functional Validation

Artifact: JS-1838-fv.zip

Once the file is attached to the PR description, unzip and run:
./run.sh

Expected output is in expected-output.txt. The README shows the
before/after comparison so you can reproduce the difference directly.

⚠️⚠️ This is not ready for review ⚠️⚠️

@hashicorp-vault-sonar-prod
Copy link
Copy Markdown

hashicorp-vault-sonar-prod Bot commented Jun 5, 2026

JS-1838

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Jun 5, 2026

Analyzing CI failures

Code Review ✅ Approved

Implements the selector-anb-no-unmatchable CSS rule to detect invalid formulas like :nth-child(0), including comprehensive analyzer tests and profile updates. No issues found.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant