nesting-selector-no-missing-scoping-root
Disallow missing scoping root for nesting selectors.
& {}/** ↑ * This nesting selector */Use this rule to avoid styling the root element by mistake. Browsers resolve & outside a nested rule to the root element, as there is no parent to refer to.
This rule doesn’t have any message arguments.
Options
Section titled “Options”{ "nesting-selector-no-missing-scoping-root": true}The following patterns are considered problems:
& {}@media all { & {}}@scope (&) {}The following patterns are not considered problems:
a { & {}}a { @media all { & {} }}a { @scope (&) {}}Optional secondary options
Section titled “Optional secondary options”ignoreAtRules
Section titled “ignoreAtRules”{ "ignoreAtRules": ["array", "of", "at-rules", "/regex/"] }Ignore nesting selectors within specified at-rules.
Given:
{ "nesting-selector-no-missing-scoping-root": [ true, { "ignoreAtRules": ["--foo", "/^--bar-/"] } ]}The following patterns are not considered problems:
@--foo { & {}}@--bar-baz qux { & {}}