10

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.

1
  • Same, exclusion values of *, **, **/* or **/*.js do not work either. Commented Apr 28, 2016 at 10:55

3 Answers 3

2

This works for me (with IntelliJ version 2017.2)

sonarLint settings

Sign up to request clarification or add additional context in comments.

5 Comments

y won't down voters explain the reason when downvoting
This solution isn't working for me, so I'll downvote it
@GillesBodart which version of intellij you are using ?
@ElmaCherb 2017.2.1
there are some changes in version 2017.3.4 of intellij, and SonarLint 3.2.1.2406. In file exclusion i put only **/*.js. In the SonarLint tab at the bottom i have this message when i open a JS file: "This file is not automatically analysed"
1

Current method to exclude files (feb 2020):

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

**/*.js

Comments

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 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.