Add linter to enforce the guideline of Global Variables First
Description
Following the decision on the RFC: gitlab-org/frontend/rfcs#3 (closed) it would useful to have a custom linter for SCSS (style-lint) that would check for:
- variable reassignment.
This is not a strict requirement, so we can choose to go with a warning or an actual failure. If we choose to do a failure, all current instances (~100) need to have this linter disabled.
Examples
// Bad
$my-space: $gl-font-size-16;
$my-white: $white-light;
// Good
margin-bottom: $gl-font-size-16;
background-color: $white-light;
Reasons for exceptions will be documented in the docs. Special scenarios mentioned in gitlab-org/frontend/rfcs#3 (closed)
Edited by André Luís