at-extend-no-missing-placeholder
What it does
Section titled “What it does”Reports an @extend of anything but a placeholder selector (%name); a selector with interpolation is not reported.
Why it matters
Section titled “Why it matters”Extending a class or an element rewrites every selector that mentions it, so one @extend can add many selectors to the output and change the cascade of rules that are far from it. A placeholder exists only to be extended, so the effect is local.
To fix, extend a placeholder, or use a mixin.
Example
Section titled “Example”With this configuration:
no-global-function-names: warnat-mixin-argumentless-call-parentheses: warnat-rule-conditional-no-parentheses: warnat-extend-no-missing-placeholder: warnat-if-no-null: warnload-no-partial-leading-underscore: warndollar-variable-pattern: { level: warn, options: { pattern: "^[a-z-]+$" } }at-mixin-pattern: { level: warn, options: { pattern: "^[a-z-]+$" } }at-function-pattern: { level: warn, options: { pattern: "^[a-z-]+$" } }...a {... @include foo() using ($x) { top: 0; } @extend .b; @extend %b; @extend .c-#{$x};...Configuration
Section titled “Configuration”css: lint: rules: at-extend-no-missing-placeholder: warn # off (default), warn, errorless: lint: rules: at-extend-no-missing-placeholder: warn # off (default), warn, errorscss: lint: rules: at-extend-no-missing-placeholder: warn # off (default), warn, errorEnabled by the presets: css/stylelint-standard.
Suppress one line with sudsy-disable-next-line at-extend-no-missing-placeholder in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| stylelint-scss | scss/at-extend-no-missing-placeholder |
full |