Sonarlint Not Detecting Issues in Intelij

Please provide

  • Operating system:Windows 11 Pro Version 23H2 ,OS build 22631.3527
  • SonarLint plugin version: 10.5.0.78339
    *InteliJ 2024.1
  • Programming language you’re coding in: Javascript
  • Is connected mode used: No
    • Connected to SonarCloud or SonarQube (and which version):

And a thorough description of the problem / question:

Sonarlint has stopped detecting certain issues in Intelijj, but still detects them in Vscode. Attached are the same lines of code, one from Intelij, and one from Vscode. Rolling back to a previous Intelij version fixes the issue, and the problems are detected.


These are just some examples, I could not upload more screenshots.

Hi @Emil_Yordanov

Can you share with me which rule it is?

Thank you

Hello Emil, I have not reproduced the issue. With the following code snippet:

const character_affection_pairs = [];

const sorted_affection_pairs = character_affection_pairs.sort((first_pair, second_pair) => {
    return first_pair[1] >= second_pair[1] ? -1 : 1;
});

These two issues are raised on IntelliJ:

However, not declaring the variable character_affection_pairs does not raise any issue, but this behavior is the same as on VS Code. I do not notice a difference in the two IDEs.

Could you please tell us which version of Nodejs you are using in IntelliJ? Could you also make sure that you restarted the IDE in case you modified the Nodejs path on the SonarLint settings?

Thank you

Hey guys, thanks for the replies!

I will try to give as much information as possible. I am using nodejs v20. I restarted the IDE several times just in case. The issue seems persistent on Windows and Linux when I install a fresh version of the IDE. I have attached two screenshots - one from a working instance on Windows and one on Linux where the problem mentioned can be seen. Again, this happens on both operating systems.

What seems even stranger is that it reports flaky tests (jest retry times being used) on the problematic instance - javascript:s5937 but does not report it on the other ones.

So basically in one case it is reporting the jest retry times and nothing else. And before it did not report that one, but did report all else (which is my desired behavior)




Thank you, @Emil_Yordanov, for the detailed information you provided, and I apologize for the late reply.

Would it be possible to send us a reproducible example of the code you are using?