Type script code is being ignored by sonarcloud

Sorry cannot share the github link it is a private repo. I started having this problem a few days ago. The dashboard started showing this error

The main branch has no lines of code.

It is a node based project. I am using Github as my code repository. I don’t have steps to reproduce it . Receiving this error for any project. One change we made though. Installed a plugin for pull request analysis on github.
EDIT- I realised that it is an issue with the typescript code. The folders with typescript are not getting analysed
Please provide some help here.

Template for a good new topic, formatted with [Markdown](https://commonmark.org/

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
  • Scanner command used when applicable (private details masked)
  • Languages of the repository
  • Only if the SonarCloud project is public, the URL
    • And if you need help with pull request decoration, then the URL to the PR too
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
  • Steps to reproduce
  • Potential workaround


Which CI tool are you using ? With which Scanner ?

Are you analyzing the default branch of your repo each time ?


No CI tool , just the sonar auto analysis. The way auto analysis works is, every PR over any branch is analysed and every PR or PUSH over default branch is analysed but in this case typescript code is being ignored.

Hello @Play9win,

Could you share the ID of the latest background task where the TypeScript files are not analyzed? I’ll have a look. You can find this by going to Your Project > Administration > Background Tasks.



^ this is the id

NodeJS is required to scan TypeScript.

In order to analyze TypeScript code, you need to have Node.js >= 8 installed on the machine running the scan. If standard node is not available, you have to set property sonar.nodejs.executable to an absolute path to Node.js executable.

Do you have NodeJS executable on your CI?

We are not using CI for analysis. Like I said earlier, we are using autoanalysis of Sonarcloud.

Sorry, I didn’t know about Automatic Analysis Feature.

Do you have .sonarcloud.properties file in your repository? If yes, what is the content?

Could you add a screen of Administration > General Settings > Analysis Scope configuration of your project?

1 Like

Hello @Play9win,

I can see in our internal logs that your Typescript analysis fails with the following message: File '@loopback/build/config/tsconfig.common.json' not found..

It would be really useful if you could share a small project that has a similar set-up and that reproduces the problem, so we can check if we can improve Automatic Analysis to support your project.