S1128 FP with use Vue3 directive in composition api

  • sonarqube version: 9.8.0.63668

What

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'.
</script>
<template>
  <input v-focus />
</template>

Achieve

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

Reference

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.

Cheers,
Yassin

1 Like

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