Skip to content

typeImports

Reports imports that should use 'import type' syntax.

✅ This rule is included in the ts stylistic presets.

Using import type for type-only imports improves tree-shaking and makes the intent explicit. When an import is only used in type positions (type annotations, interfaces, type aliases), it should use import type syntax.

import { User } from "./types";
type Admin = User & { isAdmin: boolean };
import { Config } from "./config";
function setup(config: Config): void {}

This rule is not configurable.

If you prefer not to distinguish between type and value imports, you can disable this rule.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.