How can I supress SonarLint warnings in WebStorm for a block of code?

We have a rule in our SonarQube to warn against use of console.log() statements. But there’s one particular file where we want to use logging, so for this particular block of code we have used //START_IGNORE_SONARQUBE and //END_IGNORE_SONARQUBE . SonarQube is successfully ignoring those warnings, but SonarLint is not. I’d like to suppress those warnings without having to use //NOSONAR in every single line.

I’ve already tried using @SupressWarnings() , but WebStorm doesn’t understand this statement.

Hi @dhAlcojor

This is a limitation of SonarLint. We don’t support issue exclusions based on start/end regexp. Please follow:

1 Like