Skip to content

load-no-partial-leading-underscore

Reports a @use, @forward or @import of a partial with a leading underscore (@use 'a/_b'). CSS imports are not reported.

Sass looks the partial up without the underscore, so the underscore is noise that makes a path look like a different file.

To fix, write the name without the underscore: @use 'a/b'.

With this configuration:

no-global-function-names: warn
at-mixin-argumentless-call-parentheses: warn
at-rule-conditional-no-parentheses: warn
at-extend-no-missing-placeholder: warn
at-if-no-null: warn
load-no-partial-leading-underscore: warn
dollar-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-]+$" } }
Reported
@use "a/_b";
@use "c.css";
...
css:
lint:
rules:
load-no-partial-leading-underscore: warn # off (default), warn, error
less:
lint:
rules:
load-no-partial-leading-underscore: warn # off (default), warn, error
scss:
lint:
rules:
load-no-partial-leading-underscore: warn # off (default), warn, error

Enabled by the presets: css/stylelint-standard.

Suppress one line with sudsy-disable-next-line load-no-partial-leading-underscore in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
stylelint-scss scss/load-no-partial-leading-underscore full