Sorry but I don’t follow, in your example you have a string containing template-like syntax ${x} which is not actually evaluated. str will NOT have value <Component :style='{ width: 100pt }'/>.
um yes, you are right. the example does not give the full picture.
actually, str is going to be evaluated by a framework that knows how to transform an attribute value like ‘{ width: `${size}pt` }’ in such a component string.
still, i think sonarlint should take the ticks into account before considering the template literal placeholder being inside of a normal string…
How SonarLint can know that presence of backticks inside of string literal means something special? I can recommend you disabling the rule if you are using such templating system as probably most (or all) of reported issues will be wrong.
yes i see, this would be too much magic indeed. gotta think about what is worse, disabling the rule or living with the sonarqube alert… thanks for your insights, elena.
one late remark because i found out there is a pretty easy solution to this, anyway, by simply wrapping the whole expression into a template string and reorganizing the quotation marks: