New Rule: `no-unscoped-nesting-selector`
- Dominant language
- JavaScript
- Stars
- 308
- Forks
- 44
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 18
Description
### Rule details
Disallow the nesting selector (`&`) in a context with no scoping root
### What type of rule is this?
Warns about a potential problem
### Example code
```css
/* ✗ no enclosing style rule: per css-nesting, `&` here "represents the same
elements as :scope", so this silently styles the root element */
& {
color: red;
}
/* ✓ the enclosing style rule is the scoping root */
a {
& span {
color: red;
}
}
```
### Prior Art
https://stylelint.io/user-guide/rules/nesting-selector-no-missing-scoping-root
### Participation
- [x] I am willing to submit a pull request to implement this rule.
### AI acknowledgment
- [x] I did not use AI to generate this issue report.
- [ ] (If the above is not checked) I have reviewed the AI-generated content before submitting.
### Additional comments
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.