How to suppress errors in SonarJS for a single line?

1.7k views Asked by At

I'm trying to use Sonar with Javascript, and rather than ignoring errors after analysis in SonarQube, I'd like to just comment some lines with so that they never get flagged. (Something like the // NOSONAR comment in Sonar for Java that suppresses an error on the following line, or the eslint-disable-line for eslint).

I'd like to document the ignored Sonar issues in the code, rather than in the sonarqube database.

Part of the reason I want this is because for the moment we're just installing sonar on each developers machine, (using brew and a shell script), so each dev has their own database.

1

There are 1 answers

1
Elena Vilchik On

NOSONAR should work for SonarJS as well. But it's really not recommended way to go, prefer using "won't fix" in SonarQube UI