Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 586 Bytes

declaration-use-variable.md

File metadata and controls

31 lines (22 loc) · 586 Bytes

Pattern: Missing use of variable

Issue: -

Description

Preprocessers like SCSS, Less uses variables to make the code clean, maintainable and reusable. This rule enforces the use of variables based on custom configuration.

Example of incorrect code:

$some-cool-color: #efefef;

.panel {
    display: inline-block;
    text-align: center;
    color: #efefef; // Wait a min! there should be a variable.
}

Example of correct code:

$some-cool-color: #efefef;

.panel {
    display: inline-block;
    text-align: center;
    color: $some-cool-color;
}