Skip to content

importTypeSideEffects

Reports imports that use inline type qualifiers on all specifiers when a top-level type qualifier should be used instead.

✅ This rule is included in the ts logical presets.

When using TypeScript’s verbatimModuleSyntax option, imports with inline type qualifiers on every specifier (like import { type A, type B }) get transpiled to an empty import statement (import "mod"). This creates an unnecessary side-effect import at runtime.

Using a top-level import type declaration ensures the entire import statement is removed during transpilation.

AEimpo53 <{ sp ansty="le--0:#C792EA;--1:#8844">AEty53 A <} sp ansty="le--0:#C792EA;--1:#8844">AEfr5<3 sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dfli1<1"sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meco"><";d>AEimpo53 <{ sp ansty="le--0:#C792EA;--1:#8844">AEty53 A<, sp ansty="le--0:#C792EA;--1:#8844">AEty53 B <} sp ansty="le--0:#C792EA;--1:#8844">AEfr5<3 sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dfli1<1"sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meco"><";d>
44AEim344AE3F53 { A, 44AE31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Df1<111" spans="tyle--0:#D6DEEB;--1:#40">3<;di vdivclass="Nameexpressive-">6376// Mixed type and value imports are all44AEim3F53 { val44AE3F53 44AE31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Df1<111" spans="tyle--0:#D6DEEB;--1:#40">3

This rule is not configurable.

If you’re not using TypeScript’s verbatimModuleSyntax option and your bundler handles import optimization for you, this rule may not be necessary.