dollar-variable-empty-line-before
What it does
Section titled “What it does”Reports a $variable declaration with no empty line before it. One that is first in its block, right after a comment or another $ variable, or in a single-line block is not reported.
Why it matters
Section titled “Why it matters”A group of Sass variables is the settings of a block, and a gap before it sets it off from the rules and declarations around, so the settings are easy to find.
Example
Section titled “Example”With this configuration:
dollar-variable-empty-line-before: warncustom-property-empty-line-before: warndouble-slash-comment-empty-line-before: warnno-empty-comment: { level: warn, options: { separators: true } }....x { $d: 4; color: red; $e: 5;... --g: 7;...Configuration
Section titled “Configuration”css: lint: rules: dollar-variable-empty-line-before: warn # off (default), warn, errorless: lint: rules: dollar-variable-empty-line-before: warn # off (default), warn, errorscss: lint: rules: dollar-variable-empty-line-before: warn # off (default), warn, errorEnabled by the presets: css/stylelint-standard.
Suppress one line with sudsy-disable-next-line dollar-variable-empty-line-before 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/dollar-variable-empty-line-before |
full |