Import statement coverage in TypeScript

Hello, How can I have sonarqube ignore import statement coverage in typescript ? I read about executable line concept and thought that imports are already ignored by sonarqube as mentioned here :

https://docs.sonarqube.org/latest/extend/executable-lines/

Is there a setting in sonarqube that I have to enable to ignore it. Because of inclusion of import statement my coverage is dropping significantly.

Image Below :

Any help is greatly appreciated.

2 Likes

Hello Rajat,

Thank you for your message, and welcome to the SonarSource community!

As you correctly pointed it out, import statements should be ignored, which unexpectedly doesn’t seem to be the case for you here. In order to help you, I would need to know which SonarQube version you are using, the logs of the scanner when you are running an analysis, and a minimal project with a code snippet that reproduces the problem you are encountering.

Also, you might want to try using the latest version of SonarQube and see whether this problem still occurs as it could have been fixed in more recent SonarQube versions.

Regards,
Yassin

+1 Facing same issue, @rajat did yours got resolved?