Bitbucket Pipe SonarCloud Scan fails for recent versions of TS code

I’m getting a compilation error when running the analysis of my TS files in Bitbucket pipelines using SonarCloud Scanner pipe (https://bitbucket.org/sonarsource/sonarcloud-scan/src/master/). Here’s part of the logs:

INFO: Sensor SonarTS [typescript]
INFO: Load project repositories
INFO: Load project repositories (done) | time=102ms
INFO: Analyzing 160 typescript file(s) with the following configuration file /opt/atlassian/pipelines/agent/build/cloud/tsconfig.json
INFO: 160 files analyzed out of 160
ERROR: Compilation error at <path-to-file>:12 "Expression expected."

When checking out these errors, it seems like TS compiler used here is not aware of optional chaining, which was introduced in TS version 3.7.

I’m using pipe version 1.0.1.
(Also specifying report paths using sonar.javascript.lcov.reportPaths param)

Seems like the scanner here is not using the latest TS code analyzer.

Actually seems like this was due to some other issue in our build process. Please dismiss!

2 Likes