Not able to detect javascript:S3760 in VScode

  • Operating system: Windows 10 Enterprise
  • SonarLint plugin version: v3.13.0
  • Programming language you’re coding in: javascript

Not able to detect noncompliant code for javascript:S3760
The example code for noncompliant code in the desription(S3760) is even not detected.

  const str = '80';
  const quarter = str / 4; // Noncompliant

I checked javascript:S3760 rule was enabled at Javascript, SONARLINT RULES.
I was wondering if anyone could let me know what I need to do to enable S3760 rule.

Hello :wave: @hugh and welcome to the Sonar Community forum :sonar:

Before we deep dive into an investigation, I would like to double-check that the S3760 rule is truly enabled on your machine. Note that for the rule S3760 is disabled by default and in order to enable it you would need to click the activate tick icon :heavy_check_mark: (see the screenshot).

Can you please confirm that the S3760 rule is indeed enabled on your setup?

After enabling the S3760 and using the code sample you provided, an expected issue is raised on my machine.

Also, please note that the latest version of SonarLint plugin for VSCode is 3.19.0 and we encourage all devs to use it as it has the latest features and fixes for our analyzers.

Best,

Vojtech from :sonarlint:

2 Likes