SonarLint warning typescript:S6582 but using typescript 3.5

  • Operating system: Windows 10
  • SonarLint plugin version: 4.5.1
  • Programming language you’re coding in: Typescript v3.5.3
  • Is connected mode used:
    • Connected to SonarQube v10.3 (build 82913)

SonarLint for VSCode is signaling the typescript:S6582 issue with this code:

if (response && &&

The problem is that i am currently using TypeScript version 3.5.3 that does not support the optional chain expressions (there were introduced in version 3.7).
I cannot upgrade TypeScript. I tried to disable the rule locally but given that i am using the connected mode, sonarqube is overruling the local settings. I also prefer to no create a copied quality profiles because i like that the quality profile is updated automatically.
Is there a solution for this problem?

Hi Sebastiano,

You can disable the rule in the QP inherited from the built-in profile and still receive updates! This feature was added in SQ 10.3, so you should be able to use it (or you need to ask someone with admin rights).

We are also considering detecting older TS versions and disabling such rules automatically; however, we need to collect data on how many users would benefit from this.

I have created an inherited quality profile but when i try to deactivate the rule the button is disabled and it says “this rule is inherited and cannot be deactivated”

I have also tried to upgrade to sonarqube but nothing changed

Could you share a screenshot? It definitely should work. I just did it on our instance. You should see the “Tibor test” profile here.

It doesn’t include the rule and still inherits from the built-in Sonar way profile.

As you can see from the screenshot i have created an inherited qp but i cannot deactivate the rule

To be honest, I am not so familiar with quality profile administration. Do you have Administer Quality Profiles privilege?

Yes, I’am using the admin user that has the quality profile administer privilege.
The tooltip in the button explicitly says that This rule is inherited and cannot be deactivated

Deactivating a rule inherited from a parent quality profile is a feature that can be toggled by an instance administrator, in the “General Settings”:



It worked, thank you very much!!

1 Like

thanks for helping out, @JBL_SonarSource; I was not aware of this! :slight_smile:

1 Like

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