Remove this unused import of “xxx”,there seems to be something wrong with this rule

Must-share information (formatted with Markdown):

  • SonarQube 9.9.1
  • CI system used: GItLab
  • Scanner command used when applicable (private details masked)
    Default GItLab yaml task
  • Languages of the repository:Typescript + Vue3
  • Error observed
    Unnecessary imports should be removedtypescript:S1128

In a Vue3 project, using Typescript , we have hundreds of smells about "Remove this unused import of ‘XXX’.

Hello @zhijie.hao,

Welcome to the Sonar community, and many thanks for the feedback!

Indeed, the rule is wrongly reporting a false positive issue. It seems the rule is not considering yet another corner case of unused imports.

I created this ticket to address this problem as soon as possible.

Thank you,
Yassin