style: lint SCSS files with Prettier
Our guidelines state that
Our code is automatically formatted with Prettier to follow our style guides. Prettier is taking care of formatting .js, .vue, and .scss files based on the standard prettier rules.
However, GitLab UI's setup does not enforce Prettier formatting for SCSS files and some of our stylesheets are formatted in a way that is not compatible with Prettier rules, which can be troublesome for engineers using Format on Save because they might end up with unexpected diffs when working in unformatted files (see !783 (comment 221952183)).
This MR enhances the stylelint
script so that it applies Prettier formatting on SCSS files.
To achieve this, the following packages have been installed and added to our .stylelintrc
:
-
stylelint-prettier
: Runs Prettier as a Stylelint rule and reports differences as individual Stylelint issues -
stylelint-config-prettier
: Turns off all rules that are unnecessary or might conflict with prettier.
Edited by Paul Gascou-Vaillancourt