Typescript: import type and value from same module

Hello!
I have normal import and type import from same file. For example:

import type { Foo } from './module';
import { Bar } from './module';

But analysis show me Code Smell about that they should be merged (rule).

But I prefer to split type and normal import from same file. What I should do (except disable rule) to make it not mark it as code smell?

SonarQube 8.6 (build 39681)
SonarScaner CLI 4.5.0.2216

Hello @KainStropov,

Welcome to SonarSource community.

Currently, the rule does not distinguish type imports from value imports. However, given the code sample you provided, I think it would make sense to support this distinction so that we only report on duplicated imports of the same type.

I created a ticket to address this issue.

Cheers,
Yassin

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