After upgrading Sonar Typscript plugin, typescript:S1451 now reports issues that dont apply


SonarQube 7.9.1

I recently upgraded my Sonar Typescript plugin from version 1.9 -> 2.1.

After the upgrade, my scan now reports “Track lack of copyright and license headers” findings. I am using a regular expression and the isRegularExpression is set to true.

Regular Expression -> Copyright\s[0-9]{4},\sMy(C|c)ompany,\sInc(,|.)\sAll\srights\sreserved.

Rule -> typescript:S1451

Any idea why this rule is now flagging this problem?


I was able to resolve this issue by updating the regular expression to the following:


Hello @jaystan,

A lot happened between these two versions, amongst others, TS rules implementation were migrated from java to javascript. This means that the regex flavor also changed, and is now the one from JS. It’s a guess, but it could explain why you faced this issue.

In any case, I’m glad you found a working solution on your side.