Import a type without generating runtime usage.
Section: Modules and Imports
Type-only import
typescript
typescript
import type { User } from "./types";Explanation
Type-only imports help avoid accidental runtime dependencies and can improve clarity.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Modules and Imports
Re-export from another module
Create barrel files or focused module facades.
Parse JSON into `unknown` first
Treat external JSON as unsafe until validated.