"Lines of Code" is not coming from "Typescript" files

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Developer EditionVersion 8.6 (build 39681)

  • what are you trying to achieve
    “Lines of Code” is not coming from “Typescript” files. However i can see “Lines of code” for javascript
    and html files but not for typescript files. I have defined “typescript” in devDependencies section in my
    package.json as well.

    I am using following jest command to generate coverage report only for “src” folder:
    npx jest src --silent --coverage --maxWorkers=7 --ci

    My sonar-project.properties contains following configurations:

sonar.projectKey=myprojectkey
	sonar.sources=src
	sonar.exclusions=src/_stories/**,src/services/**,src/**/*.stories.tsx*
	sonar.tests=src
	sonar.test.inclusions=src/**/*.test.tsx*,src/**/*.test.ts*,src/**/__tests__/**
	sonar.projectVersion=$VERSION
	sonar.javascript.lcov.reportPaths=coverage/lcov.info
	sonar.eslint.reportPaths=eslint.json
	sonar.login=$SONAR_KEY
	sonar.host.url=https://sonar.IP.Address
  • what have you tried so far to achieve this
    I already have defined “typescript” in devDependencies section in my package.json as well. However nothing is working.

Any help would be appreciated.

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

8.6 → 8.9.8 → 9.5 (last step optional)

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes helpful. If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.