SonarLint for JetBrains IDEs: false positive for unused import in Vue 3 with <script setup>

I am using the latest version of WebStorm with version of the SonarLint plugin and the plugin shows imported files as unimported when using the script setup syntax and kebap-case for the imported component in the template:


Reproducible example here: vue3-webstorm-example/App.vue at main · linkurzweg/vue3-webstorm-example · GitHub

Hey there.

Please make sure to read this post:

Specifically, we are missing a reproducible code/project sample (that is not a screenshot).

It would also be useful to know if you are using Connected Mode with SonarLint (connecting to SonarQube or SonarCloud).

Sorry, reproducible example here: vue3-webstorm-example/App.vue at main · linkurzweg/vue3-webstorm-example · GitHub

I am importing HelloWorldComponent here and use it in the template as <hello-world-component />. The false positive seems to only appear when I use kebap-case in the template with a component name that consists of more than two words.

I’m currently not using Connected Mode, since we are still running an older version of SonarQube on our servers that reports a lot of false positives.

Hello Lin,

Welcome to the Sonar community, and thank you for your feedback!

As you rightfully pointed out, false positives are raised whenever one refers to imported Vue components using the kebab case with more than two words. In that regard, I created this ticket to address that as soon as possible.

Thank you,

1 Like

Hello Yassin,

thank you very much! I will subscribe to the GitHub issue.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.