"Remove this unused import" when a type is actually used


The VSCode SonarLint extension warns be about an unused import of a type I actually use

// ...
import { AdditionalPanelComment } from '@/types';
// Remove this unused import of 'AdditionalPanelComment'.sonarlint(javascript:S1128)
// ...
comments(): AdditionalPanelComment[] {
// ...

I’d guess it’s because types are not actually used at runtime, so SonarJS might get confused? I don’t really know what’s happening under the hood. In any case, here’s my env:

Ubuntu 20.10
VSCode 1.52.1
SonarLint 1.19.0

Hello Nino!
Welcome to SonarSource comunity and thanks for your feedback.
Sorry response took so long. I tried to reproduce this behavior but had no luck. May be you can attach archive with sample project where this bug appears? We will try to reproduce it anyway, but with sample project it will be faster.

Best regards