SuppressWarning in typescript

Please provide

  • Operating system: Ubuntu 20.04
  • IDE name and flavor/env: IntelliJ
  • SonarLint plugin version: 6.7.0.45926
  • Is connected mode used: yes
    • Connected to SonarCloud or SonarQube (and which version): SonarQube v9.3

And a thorough description of the problem / question:

I am wondering if there is an option to ignore a specific rule in a typescript file.

In Java you can use the @SuppressWarning annotation. Is there something like this for typescript?

Using // NOSONAR or ignoring issues in block would ignore all the issues, while I still want to see all the issues except for this one rule that I’m trying to ignore.

Thanks in advance!

Kind Regards,
Jens

3 Likes

I would like to know too.

I asked exactly the same question for C++ in this thread: https://community.sonarsource.com/t/suppress-issue-in-c-source-file.
Unfortunately, it has not been explained so far why @SuppressWarning was implemented for JAVA but not for other programming languages.
Really all other static code analysis programs support something like this.

There is good news on this subject: