css:S4670 The use of FontAwesome raises a issue

Our project uses FontAwesome icons, and we have integrated these icons according to the documentation dedicated for Angular.

But now the above code raise a " Selectors should be known" issue.

fa-icon {
     color: $darkestGray;
     font-size: 1.5em;

Is it a false positive or a setup problem?

Versions used :

  • SonarQube 6.7.7
  • SonarCSS 1.0.3 (build 724)

The rule works properly. Your code is broken. Why? SonarCSS support analysis of CSS code. You code is not a valid CSS code (checked by CSS Validation Service):

You have a file with “some” code and css extension. I think you were lucky that the analyzer was able to parse the file instead of ended the analysis with parse error.

@kbolivard I’ve created a ticket https://github.com/SonarSource/sonar-css/issues/181 to add parameter to configure such exceptions. Version should be available next week.

1 Like