Sonar rule css:S4666 is showing a false positive

Consider this simple mixin in scss

  @each $shade, $color in makeColorPalette($grayColor) {
    .color-gray-#{$shade} {
      color: $color !important;
    }
    .bg-gray-#{$shade} {
      background-color: $color !important;
    }
  }

This is showing an issue on sonar cloud against rule id css:S4666. The screenshots are attached. However, this error was not there before 3rd June. Suddenly, from 3rd June, it started appearing.

Please check.


1 Like

Hey there.

We recently deployed a new version of our CSS analyzer that upgrades the version of Stylelint used (on which this rule is based) to v14.8.4 which raises false positives for this rule on less syntax (`no-duplicate-selectors` false positives with Less syntax · Issue #6110 · stylelint/stylelint · GitHub).

Looks like we need to upgrade to v14.8.5

Thanks for this feedback. I’ll ping the relevant team.

Hello @Colin ,

When can we expect a release for this on sonarcloud ?

Hello Samarpan,

Thank you for the feedback,

We created a Ticket to track this false positive.

Best Regards,
Ilia