Skip to content

Enable DeclarationOrder in scss-lint

What does this MR do?

  • Enables DeclarationOrder in scss-lint.
  • Fixes all DeclarationOrder violations.
    • @includes - properties violations: 13 (out of 172 (*1))
    • properties - nested rule sets violations: 2 (out of too many cases)
    • @extends - properties violations: 1 (out of 54)
  • Fixes a tiny typo in comments in .scss-lint.yml.
Notes

(*1): Counted with the following command:

git grep -B1 '^ *@include' -- app/assets/stylesheets/**/*.scss | grep -c '^--$'

The rule

This rules the order of these 5 declarations as follows:

  1. @extend declarations
  2. @include declarations without inner @content
  3. properties
  4. @include declarations with inner @content
  5. nested rule sets

Are there points in the code the reviewer needs to double check?

No.

Note: @includes - properties violations ratio is 7.6% (13 out of 172), which may be relatively high.

Why was this MR needed?

To improve SCSS maintainability and consistency.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Part of #23485 (moved)

Edited by Takuya Noguchi

Merge request reports