ElSuture
(ElSuture)
May 9, 2025, 8:52am
1
Hi SonarTeam,
we have a mass of false positives in “Unnecessary imports should be removed typescript:S1128” in our Quality-Gate issues list.
Mainly caused in Vue 3 Single-File-Components with <script setup> and TypeScript, e.g.:
Version: SonarQube Server Developer Edition v2025.1 (102418)
Deployed via Docker
I use VSCode with Connected Mode to SonarQube, so I see these errors everywhere during development also.
Is there a way to fix this?
Best Regards,
ElSuture
ganncamp
(G Ann Campbell)
May 9, 2025, 5:42pm
2
Hi ElSuture,
Can we have a text reproducer? I’m looking to be able to copy/paste a code snippet into a file to get this same issue.
Thx,
Ann
ElSuture
(ElSuture)
May 27, 2025, 12:19pm
3
Hi Ann,
I forgot to mention that we use Pug in our project, so maybe there is the problem..
I can’t share our work repository, but I have created a similar one here Vue 3 Project with Quasar, Pug, and UI Components - StackBlitz for reproduction. It should have the same errors
Best regards,
ElSuture
1 Like
ganncamp
(G Ann Campbell)
June 2, 2025, 12:48pm
4
Hi ElSuture,
Thanks for the reproducer! I’ll flag this for the language experts.
Ann
Hi @ElSuture ,
I think you are right, it is due to using pug, which we currently do not support. We currently do not parse the <template> tag.
I will re-assign to @gab to keep this in mind.
Kind regards,
Michal
RichPig
(Richard Pigott)
August 28, 2025, 10:22am
9
Hi,
Do you plan to support Pug?
We also use pug in Vue3 single file components, and we are also getting hundreds of false positive Unnecessary Import errors.
Cheers,
Rich
gab
(Gabriel Vivas)
September 23, 2025, 5:30am
12
Hi everyone,
I have added this to our internal tracker to keep Pug + Vue3 file components in our radar.
If this particular rule is not helpful, you can disable it from the Quality Profile or in SonarQube IDE.
2 Likes
ElSuture
(ElSuture)
September 26, 2025, 11:32am
15
@gab when are you going to implement this?
gab
(Gabriel Vivas)
September 26, 2025, 11:48am
16
Hi @ElSuture , there’s no commitment, we are tracking interest for now!