SonarQube Cloud does not report Typescript errors

Hi! We are expanding our Typescript usage in our project. We were assuming that SonarCloud would analyze and report errors from Typescript normally seen from the tsc transpiler. Especially after reading the documentation about Typescript setup.

After testing this appears to not be the case. I used one of Sonar sample repositories for Typescript, put it into our SCM and ran Sonar steps on it with obvious errors from tsc. These do not show up on Sonar then. Are we missing some configuration for this or is it so that Sonar does not report Typescript errors?

An example error is to leave a function parameter without any typing information and we’d expect to see message “Parameter ‘session’ implicitly has an ‘any’ type.ts(7006)”.

I am considering an alternative where we format the error output from tsc in eslint style report JSON and pass that into Sonar to show the errors. This is suboptimal in my opinion.

Thank you for any assistance!

We use Bitbucket and its pipelines for running CI. Sonar does analyze our code otherwise.

Hi Mikael,

Compilation errors are not part of the report SQ ingests. This is the expected behaviour.

As for why one can configure the tsconfig.json? It is to perform our analysis and make it more inline with the setup your project has.

I hope this helps,
Cheers,
Michal

That answers it thanks. We had different expectation to it then. We’ll figure out another way to deal with measuring how our migration on Typescript is going.