How to change CSS rule "Selectors should be known"

We are catching a few bugs like this

  • Unexpected unknown type selector “app-input”
  • Unexpected unknown type selector “app-form-field-message”

We are using resource for analyzing our source code from Azure based on git cv
We are using Angular 9 and Azure pipelines with SonarCloud tasks for preparing a report analyzing data

We created a new quality gate based on Sonar Way
And wanted to change the CSS rule “Selectors should be known” with a few exceptions to the custom CSS.

I saw the issue on GitHub
But we don’t find a way how we can change a Default Value: ignoreTypes: /^(mat|md|fa)-/

Hello @mrbighokage,

You probably can’t change it because you are using the default read-only Sonar Way quality profile of SonarCloud. To change this:

  • Browse to quality profiles --> CSS, and then on the gear icon right of Sonar Way select Extend
  • Create your own quality profile named what you want (Yurii’s Way for instance)
  • Then browse to the rules, search the rule you want to customize, and next to the Yurii’s Way quality profile you’ll have a change button that will allow you to customize selectors, like below

Let me know if you could fix your problem.


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.