8

I use SonarLint in my Eclipse to analyze JAVA web project.

How to exclude js files from SonarLint analysis? It is because when I open js file, SonarLint starts to slow down the Eclipse performance.

Used version:

SonarLint for Eclipse   1.0.0.20151015-1547-RELEASE

Thanks

Valijon
  • 12,667
  • 4
  • 34
  • 67

2 Answers2

16

Go to Window->Preferences, SonarLint->Scanner Properties and add the properties:

sonar.exclusions=**/*.js
sonar.test.exclusions=**/*.js

More information about this: http://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus

SonarLint will still be triggered but it will skip all files that are JS source files. You can tune the exclusions to only exclude a subset of the js files. Also note that since SonarLint Eclipse 1.1, derived resources are excluded from the analysis.

Duarte Meneses
  • 2,868
  • 19
  • 22
  • 1
    Very useful too to ignore jpg, png, gif, log ... wich are analyzed in PHP projects. – djleop May 04 '16 at 07:31
  • This does not work for me (using the latest Eclipse Sonarlint-Plugin v3.2.x). Reading this discussion (https://groups.google.com/forum/#!searchin/sonarlint/sonar.exclusions%7Csort:relevance/sonarlint/aBxnpn-yLbg/m7uBeSo_AgAJ) `sonar.exclusions` shouldn't work right now, since only a limited set is supported so far. – user871611 Aug 16 '17 at 10:44
  • 1
    Unfortunately I have same problem for Intellij :-/ – Iwo Kucharski Oct 11 '17 at 10:48
0

If someone bumps in here looking for steps for Visual Studio 2015, here is how its done in Visual Studio:

  1. Go to Tools>Options>SonarLint For Visual Studio
  2. Click Deactivate

sonarlint

And that's it, now js files won't be analyzed

Note: This does not exclude, but deactivate Js support. If you want to specify exclusion rules,then mention the same in SonarQube project which is bound in Visual Studio. (In connected mode, sonarlint uses configuration from SonarQube)

Karan Desai
  • 3,012
  • 5
  • 32
  • 66