S1128 FP with use Vue3 directive in composition api

  • sonarqube version:


This is a false-positive report by rule " Unnecessary imports should be removed", when i use vue3 directive in composition api;

<script lang="ts" setup>
  import { vFocus } from "./directives"; // Remove this unused import of 'vFocus'.
  <input v-focus />


The rule is working go on, but the vue3 directive in composition be scanning through


Vu3 Directive

Hello @royisyoung,

Welcome to our Sonar community!

Thank you for your feedback. The code pattern that you shared denotes effectively a false positive raised by the rule S1128.

I created this ticket to address the issue as soon as possible and fix the false positive.


1 Like

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