Template string rule does not agree with original spec

Versions: SQ 8.3, scanner 4.3.0, TS plugin 2.1, JS plugin 6.2.1
Rule: typescript:S3512

The original spec for 3512 gives the following description:

This rule raises an issue when a string is created from the result of two or more concatenations.

(emphasis mine)

The same page gives the example:

function sayHello(name) {
  console.log("hello " + name);  // ignored
}

but the help text on my server for the rule shows

function sayHello(name) {
  console.log("hello " + name);  // Noncompliant
}

and flags every concatenation, even if there is only one.

The number of false positives makes the rule basically useless for my project. It should be fixed to operate as originally designed.

Hello James,

We have a ticket for this problem, and we are actually working on the fix right now. It will be part of the next release very soon.

1 Like

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