Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude JS files from on-the-fly analysis in SonarLint for IntelliJ IDEA?

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.

like image 873
Thojo Avatar asked Apr 19 '16 10:04

Thojo


People also ask

How do I include excluded files in SonarLint?

SonarLint on the left navigation of the properties for the project. File exclusions(it shows the file you excluded) Select the file in the file exclusions section.

How do I set SonarLint rules in IntelliJ?

In Intellij — Go to File >> Plugins >> Type 'SonarLint' >> Install and Restart IDE. (2) we can choose the SonarQube rules. → To integrate SonarQube(server) and SonarLint in our IDE and run SonarQube code inspection rules per class to give results quickly. Add the sonarQube connection binding.

How do I turn off SonarLint automatic analysis in IntelliJ?

Save this answer. Show activity on this post. In Android Studio 3.5. 2: Go to File -> Settings -> Tools -> SonarLint -> Settings(Tab) then uncheck the Automatically trigger analysis check box.


2 Answers

This works for me (with IntelliJ version 2017.2)

sonarLint settings

like image 96
bubbles Avatar answered Oct 20 '22 11:10

bubbles


Current method to exclude files (feb 2020):

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

**/*.js

like image 1
DGK Avatar answered Oct 20 '22 11:10

DGK