Rule variable-name-format will enforce a convention for variable names.
allow-leading-underscore:true/false(defaults totrue)convention:'hyphenatedlowercase'(default),camelcase,snakecase, or a Regular Expression that the variable name must match (e.g.^[_A-Z]+$)convention-explanation: Custom explanation to display to the user if a variable doesn't adhere to the convention
Settings:
allow-leading-underscore: trueconvention: hyphenatedlowercase
When enabled, the following are allowed:
$hyphenated-lowercase: 1px;
$_leading-underscore: 1px;
.foo {
width: $hyphenated-lowercase;
}
When enabled, the following are disallowed:
$HYPHENATED-UPPERCASE: 1px;
$_camelCaseWithLeadingUnderscore: 1px;
.foo {
width: $snake_case;
}Settings:
allow-leading-underscore: falseconvention: camelcase
When enabled, the following are allowed:
$camelCase: 1px;
.foo {
width: $anotherCamelCase;
}When enabled, the following are disallowed:
$HYPHENATED-UPPERCASE: 1px;
$_camelCaseWithLeadingUnderscore: 1px;
.foo {
width: $snake_case;
}Settings:
allow-leading-underscore: falseconvention: snakecase
When enabled, the following are allowed:
$snake_case: 1px;
.foo {
width: $another_snake_case;
}When enabled, the following are disallowed:
$HYPHENATED-UPPERCASE: 1px;
$_snake_case_with_leading_underscore: 1px;
.foo {
width: $camelCase;
}Settings:
allow-leading-underscore: trueconvention: ^[_A-Z]+$convention-explanation: 'Variables must contain only uppercase letters and underscores'
When enabled, the following are allowed:
$SCREAMING_SNAKE_CASE: 1px;
.foo {
width: $_LEADING_UNDERSCORE;
}When enabled, the following are disallowed:
(Each line with a variable will report Variables must contain only uppercase letters and underscores when linted.)
$HYPHENATED-UPPERCASE: 1px;
$_snake_case_with_leading_underscore: 1px;
.foo {
width: $camelCase;
}