11

I can't figure out, how to exclude specific source files from being analysed by SonarLint on the fly.

The FAQ suggest to configure the property sonar.exclusions. But SonarLint keeps analysing excluded files when they get opened in IntelliJ.

Exclude JS files from SonarLint covers same question for Eclipse, where it seems possible.

I'm using IntelliJ IDEA 2016.1.1 with SonarLint for IntelliJ IDEA 2.0 on Windows with an analysis property sonar.exclusions = **\components\** to exclude some external JavaScript libraries.

Also a property value of ** or other patterns do not cause SonarLint to exclude any files.

For some large library files I don't want that they get analysed because it degrades performance and the warnings clutter the wohle editor.

Community
  • 1
  • 1
Thojo
  • 406
  • 4
  • 7

3 Answers3

2

This works for me (with IntelliJ version 2017.2)

sonarLint settings

Paul Roub
  • 36,322
  • 27
  • 84
  • 93
bubbles
  • 2,597
  • 1
  • 15
  • 40
1

Current method to exclude files (feb 2020):

  1. Settings
  2. Other settings
  3. Sonarlint General Settings
  4. File exclusions
  5. Press '+'

**/*.js

DGK
  • 2,947
  • 5
  • 32
  • 47
0
These steps are for 2022 Intellij Ultimate version


Step 1 : Click on Sonarlint tab 
Step 2 : On the left hand side you should search for for settings icons,Click on that icon
Step 3 : You should see a Project settings dialog
Step 4 : Click on + 
Here you can
exclude a file: for example .html
exclude a directory: Example: Browser directory from your machine to 
exclude using Glob pattern : **/*.js  - meaning exclude all js file from sonar analysis
SlickTester
  • 129
  • 1
  • 3
  • 15