Sonar analysis running very slow on .vue files

So apparently since a few days ago (possibly around Feb 15th) the analysis runs really slow, it takes 3x the amount of time needed to finish. I also noticed it says javascript analysis before, now it says typescript analysis, even though we don’t use typescript in our code. Is this what’s causing it to run slow? is there anything i can do to change it back?

here’s my log before Feb15th

here’s after Feb15th

Hello Хахош,

Welcome to SonarSource community, and thank you for your feedback!

Since February 15, SonarCloud uses SonarJS 7.2, which introduced the support of TypeScript code inside Vue.js Single File Components. One consequence of this novelty is that JavaScript code inside Vue.js file is now parsed with TypeScript compiler to benefit from type information and analysed with TypeScript rules, including type-aware ones.

That’s basically the reason why you now see the logs mentioning TypeScript analysis instead of JavaScript when it comes to .vue files.

Using TypeScript compiler to parse JavaScript code has obviously a cost. It is mainly due to the type information the compiler needs to compute, which takes time. However, we think that this cost is acceptable because your JavaScript code now benefits from type-aware rules, which makes the analysis more accurate, and open the door to detect new code smells and bugs.

Hope this helps,
Yassin

1 Like