Why are typescript:S3504 and javascript:S3504 are not in the Sonar way profiles

Using let or const instead of var in Javascript and Typescript would seem to be a very basic, good practice but the two rules encouraging this are not on in the Javascript and Typescript Sonar Way quality profiles (in SonarQube 8.9.7). Is there a reason for this?


I agree we should add it. In the past it was not added because there were many projects not yet using modern JS features and we wanted the default profiles to be non-controversial, however, I think this argument doesn’t hold anymore, as using const and let is the norm nowadays.

I created the ticket to add the rule to the default profile S3504 should be part of SonarWay profile · Issue #3101 · SonarSource/SonarJS · GitHub

FYI: Since the release of SonarQube 9.5 (correlated to sonarjs 9.3 language analyzer), the default quality profile for JavaScript now includes javascript:S3504 and typescript:S3504 rules.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.