Operating system: Ubuntu 20.04
IDE name and flavor/env: IntelliJ
SonarLint plugin version: 22.214.171.124926
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!
I would like to know too.
I asked exactly the same question for C++ in this thread:
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:
I understand your frustration
@Matthias.Guelck. We looked at the problem recently and right now the direction we will be taking will be to:
deprecate the use of //NOSONAR alone
request a RuleKey (or multiple keys) to be provided like “//NOSONAR(S123, S222, …) Justification” => very similar to @SuppressWarnings(“squid:S…) but more language agnostic
automatically Open and Close as Won’t Fix issues that are silenced by this mechanism for traceability purpose
Would that work for you?