SonarQube reports false unused imports in Vue3 Composition API

Hi,

I’ve recently created a new Vue 3 project and was playing around with the new script setup.
But SonarQube doesn’t seem to be able to match import in the script setup and its usage in the template.
In all my .vue using imports, SonarQube was giving false negative.

I’ve put a link below to the github repo to recreate the issue.

  • Scanner version : sonar-scanner-cli-4.6.2.2472-windows
  • Docker SonarQube version : 8.9.1.44547

Github repo : sonique

Thanks in advance for your time,

Victor GUEGAN

1 Like

Yep, same issue for me. Also reports issues when importing *.vue components.

I believe SonarQube uses vue-eslint-parser to report these things according to this link:
https://jira.sonarsource.com/browse/MMF-1441

According to their release notes, vue-eslint-parser has implemented support for Vue’s new <script setup> syntax on July 1:

Sonar devs, please update this dependency to support Vue’s new SFC syntax. You can find the rfc for it here: