Please provide
- Operating system: Ubuntu 22.04.2
- SonarLint plugin version: v3.15.1
- Programming language you’re coding in: JavaScript, Vue
- Is connected mode used:
- Connected to SonarCloud or SonarQube (and which version): No
And a thorough description of the problem / question:
Here are my files:
vFocus.js
export const vFocus = {
mounted: (el) => el.focus()
}
Foo.vue
<script setup>
import { vFocus } from './vFocus' //Remove this unused import of 'vFocus'. sonarlint(javascript:S1128)
</script>
<template>
<input v-focus />
</template>
sonarLint does not detect correctly that I am in fact using the custom directive a few lines down.
The Vue syntax highlighter detects the usage correctly:
Unused import, vFocus
is dimmed:
Used import, vFocus
is not dimmed anymore: