Skip to main content

block-no-redundant-nested-style-rules

不允许在块内嵌套冗余的样式规则。

¥Disallow redundant nested style rules within blocks.

a { & { color: red; } }
/** ↑

* This nested style rule */

选项

¥Options

true

{
"block-no-redundant-nested-style-rules": true
}

以下模式被视为问题:

¥The following patterns are considered problems:

a { & { color: red; } }
a { @media all { & { color: red; } } }

以下模式不被视为问题:

¥The following patterns are not considered problems:

a { color: red; }
a { @media all { color: red; } }
a { &.foo { color: red; } }