I have setup a connection mode with a token to sonarqube. One thing that confuses me is that it seems the wrong nodejs version is displayed. My main problem is the mismatch of problems that are displayed on sonarqube and sonarlint. As i understand they should display roughly the same rules in conncted mode.
Hello @markjuric, thanks for reaching out to us about this issue.
There appears to be a problem with how we load Node.js as defined by the user. It seems that when opening the settings, we set Node.js to the automatically detected version on your machine (for example, it will likely take the node version that appears when typing node -v). In this case, when changing the Node.js version, I would recommend not opening the settings afterward until we fix this issue.
Also, please note that when setting a specific Node.js path, it will be considered on the next restart (we have this ticket tracking this improvement). However, as I mentioned, opening the settings dialog will reset this path to the automatically detected node, so do not re-open the settings after modifying the path.
To make sure that you are using the correct version, you can enable logs in SonarLint, analyze a JS/TS file, and verify that you are using a specific node version by checking this log:
Regarding the bug of loading the automatically detected Node.js version when opening the SonarLint settings, I have created this ticket that we will tackle for the next release.
Lastly, as mentioned by our requirements page, we support analysis of JS/TS with Node.js >= 16, and we recommend using Node.js >= 18.
There could be many reasons for the mismatch with the issue from SonarQube. Normally, we should effectively display the same issue between SonarQube and SonarLint in Connected Mode.
Could you try without Connected Mode to see if the issues are raised?
We would also appreciate a reproducible code snippet of an issue that was not reported locally but on your SonarQube server. Sharing the SonarLint logs of an analysis could also help.
For logs do you mean the tab in the view that says log because i there is no log about the version of node.js under that log
on this image you can also see that when im not in connected mode that i have only unused import issue
here is an example of one rule
I am unable to provide logs, sry.
If you follow our documentation to get logs, you should see the Node.js mention.
- Open the SonarLint tool window: View > Tool Windows > SonarLint.
- Enable the Analysis logs and Verbose output in the tool window settings.
- Find the logs in the Log tab of the tool window.
Otherwise, it would help to have an example of your code or a fake example where you reproduce the same behavior.
Its ok now i was using third party and needed detekt, but for logs i dont know if it changed but settings for verbose and analysis are under the 3 dot options button in logs.