Rules (probably) being downloaded from on premise SonarQube server, but not applying via SonarLint VSCode plugin

I’m using VS Code 1.28.2 with SonarLint 1.5.0 (I see 1.6.0 in the marketplace, but it always downloads 1.5.0 for some reason) and have configured my sonar-project.properties and user settings sonarlint.connectedMode.servers values. I’ve also created a gulp task and have been able to successfully run that in order to do a code analysis on the SonarQube server which works. I’ve checked this directory: C:\Users*username*.sonarlint\storage*localServerId*\global\active_rules and I’ve found references to rules on the server so my best guess is that it did manage to download the rules from our SonarQube server.

One problem is that the ‘Problems’ tab in VS Code doesn’t scan the entire project: if I open a given file it will scan it and report some problems, but that seems like a poor implementation if that’s simply how the plugin works.

The bigger problem is that it doesn’t seem to be regarding these potentially downloaded rules from our server. I can log into our SonarQube server and see a rule such as Typescript rule S1440 regarding ‘===’ vs ‘==’, but if I try creating some code in my editor that should show this as a problem, it doesn’t actually identify it. I’m guessing it’s using the default ruleset and not our custom rules.

Hi @sykotron

Many different points, I will try to tackle them one by one :wink:

I see 1.6.0 in the marketplace, but it always downloads 1.5.0 for some reason

SonarLint 1.6.0 requires VSCode 1.30.0+ so I guess VSCode is smart enough to download the latest compatible version.

have configured my sonar-project.properties

This is the configuration of the SonarScanner. It is not used by SonarLint.

user settings sonarlint.connectedMode.servers values

Have you also configured workspace level sonarlint.connectedMode.project to actually bind the project?

One problem is that the ‘Problems’ tab in VS Code doesn’t scan the entire project

This is how VSCode works. AFAIK all other linters (at least the one based on the language server protocol) work like this.

The bigger problem is that it doesn’t seem to be regarding these potentially downloaded rules from our server. I can log into our SonarQube server and see a rule such as Typescript rule S1440 regarding ‘===’ vs ‘==’, but if I try creating some code in my editor that should show this as a problem, it doesn’t actually identify it. I’m guessing it’s using the default ruleset and not our custom rules.

Do you see some other issues coming from rules that are in the default profile (look at SonarWay)? Or maybe you see no issues at all, which can be a totally different issue?