All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.javascript.rules.javascript.S3786.html Maven / Gradle / Ivy

There is a newer version: 5.0.0.6962
Show newest version

Why is this an issue?

Template strings allow developers to embed variables or expressions in strings using template literals, instead of string concatenation. This is done by using expressions like ${variable} in a string between two back-ticks (`). However, when used in a regular string literal (between double or single quotes) the template will not be evaluated and will be used as a literal, which is probably not what was intended.

Noncompliant code example

console.log("Today is ${date}"); // Noncompliant

Compliant solution

console.log(`Today is ${date}`);




© 2015 - 2025 Weber Informatics LLC | Privacy Policy