Vue component with more than 2 words erroneously marked as unused import

  • Operating system: Windows 10 (WSL2 - Ubuntu 20.04)
  • SonarLint plugin version: v3.6.0
  • Is connected mode used: Yes
    • Connected to SonarCloud or SonarQube (and which version): SonarQube Community

And a thorough description of the problem / question:

The following code produces the error
Remove this unused import of 'MyAwesomeComponent'. sonarlint(javascript:S1128)
on the line with the import statement.

<my-awesome-component />

<script setup>
import MyAwesomeComponent from '@/components/MyAwesomeComponent.vue'

Making the following modification resolves the error:

<awesome-component />

<script setup>
import AwesomeComponent from '@/components/MyAwesomeComponent.vue'

This seems to be a bug?

Hey there.

It looks like you’re facing Fix FP S1128 ('unused-import'): Generalize imports matching kebab case references · Issue #3125 · SonarSource/SonarJS · GitHub, which should be fixed in the next release of SonarLint for VS Code.

1 Like

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