From 063d80e0e75b12a88c5beb57fb14ff01bb4b374c Mon Sep 17 00:00:00 2001 From: Kevin Dew Date: Wed, 2 Sep 2020 11:54:47 +0100 Subject: [PATCH] Update stylelint disable comments for Stylelint 13.7.0 In stylelint 13.7.0 they now treat multiline SCSS comments as a single comment [1] which means the disabling techniques we previously used no longer work. By adopting this new syntax the reasons are also understood to be associated with the rule and can allow switching on the reportDescriptionlessDisables option [2] which can require the disabling of rules to always be documented. For example ``` // comment describing disabling // stylelint-disable indentation ``` is treated as a comment of: "comment describing disabling stylelint-disable indentation" Instead this can be resolved with the following technique: ``` // stylelint-disable indentation -- comment describing // disabling ``` This therefore updates all of the stylelint disabling of rules to match this pattern. [1]: https://github.com/stylelint/stylelint/issues/4886 --- src/govuk/helpers/_device-pixels.scss | 4 ++-- src/govuk/helpers/_font-faces.scss | 1 + src/govuk/helpers/_spacing.scss | 4 ++-- src/govuk/settings/_colours-palette.scss | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/govuk/helpers/_device-pixels.scss b/src/govuk/helpers/_device-pixels.scss index 83cd3cc07e..6a5e77aa65 100644 --- a/src/govuk/helpers/_device-pixels.scss +++ b/src/govuk/helpers/_device-pixels.scss @@ -28,8 +28,8 @@ /// @access public @mixin govuk-device-pixel-ratio($ratio: 2) { - // stylelint and sass-lint have a disagreement over indentation in this file - // stylelint-disable indentation + // stylelint-disable indentation -- stylelint and sass-lint have a + // disagreement over indentation in this file @media only screen and (-webkit-min-device-pixel-ratio: $ratio), only screen and (-o-min-device-pixel-ratio: #{($ratio * 10)} / 10), only screen and (min-resolution: #{($ratio * 96)}dpi), diff --git a/src/govuk/helpers/_font-faces.scss b/src/govuk/helpers/_font-faces.scss index 2abab5b880..cfd03fd65f 100644 --- a/src/govuk/helpers/_font-faces.scss +++ b/src/govuk/helpers/_font-faces.scss @@ -4,6 +4,7 @@ // Disables linting for this file only // sass-lint:disable no-css-comments, no-duplicate-properties, property-sort-order, indentation + // stylelint-disable scss/comment-no-loud, order/properties-order @import "../tools/exports"; diff --git a/src/govuk/helpers/_spacing.scss b/src/govuk/helpers/_spacing.scss index d0bbc02a62..e529de503d 100644 --- a/src/govuk/helpers/_spacing.scss +++ b/src/govuk/helpers/_spacing.scss @@ -2,8 +2,8 @@ /// @group helpers/spacing //// -// stylelint and sass-lint have a disagreement over indentation in this file -// stylelint-disable indentation +// stylelint-disable indentation -- stylelint and sass-lint have a +// disagreement over indentation in this file /// Single point spacing /// diff --git a/src/govuk/settings/_colours-palette.scss b/src/govuk/settings/_colours-palette.scss index 7fc73452e9..0b778047c3 100644 --- a/src/govuk/settings/_colours-palette.scss +++ b/src/govuk/settings/_colours-palette.scss @@ -1,7 +1,7 @@ @import "compatibility"; -// allow empty lines in lists in this file to allow grouping -// stylelint-disable value-list-max-empty-lines +// stylelint-disable value-list-max-empty-lines -- allow empty lines in lists +// in this file to allow grouping //// /// @group settings/colours