Hello
This is a follow-up of Fix FP S1128 (`unused-imports`): Vue.js imports used in templates · Issue #3484 · SonarSource/SonarJS · GitHub (the issue it’s not fully resolved for me) and what I commented beginning here
I copy-paste the body of that issue, so it can be searchable here in the forums as well:
I can share the full files without issues, since I'm working in a open source project. This code smell is reported 3 times in my repo. I attach the relevant line that SonarCloud highlights and the ID of the detected code smell in the dashboard (obtained from the `open` query parameter):
* `AYdGwQKIUNJ8O0FnkdeL`: https://github.com/jellyfin/jellyfin-vue/blob/master/frontend/src/components/Layout/Carousel/Carousel.vue#L53
* `AYdGwQLbUNJ8O0FnkdeO`: https://github.com/jellyfin/jellyfin-vue/blob/master/frontend/src/components/Layout/SwiperSection.vue#L47
* `AYdGwQTPUNJ8O0Fnkde-`: https://github.com/jellyfin/jellyfin-vue/blob/master/frontend/src/pages/playback/music/index.vue#L85
Some key things I noticed:
* All 3 of them are `Remove this unused import of 'Swiper'`. It looks like `SwiperSlide` is correctly detected as used without issues.
* I wonder if it has to do because I also import `Swiper` as a type? (But I don't in all of them)
* I have another guess in that the import is from `swiper/vue` and not `swiper`, and all the affected files import both from `swiper` and `swiper/vue`.
* Local eslint (with `eslint-plugin-imports`) doesn't detect any of those as unused. It does if I remove those components from the template (as expected), so this issue is solely in Sonar's side.
Don't hesitate in contacting me if you need further details to triage this issue or there's something else I can be helpful with to help with this.
- ALM used: GitHub
- CI system used: GitHub SonarCloud app
- Languages of the repository: TypeScript
- Only if the SonarCloud project is public, the URL: GitHub - jellyfin/jellyfin-vue: A modern web client for Jellyfin based on Vue