type-only-imports
What it does
This skill checks TypeScript import statements and marks type-only imports correctly. It is for developers who want smaller bundles and fewer dependency problems.
When to use it
- ✓When a TypeScript file imports modules that are only used as types.
- ✓When a bundle includes modules that seem to be pulled in only for types.
- ✓When setting up a new TypeScript project with clean import rules.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/type-only-imports/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“My TypeScript build is pulling in a big module that I only use for types. Can you fix the imports?”
5 new skills a week. 1 minute to read.
How it works
The agent finds imports used only as types and changes them to import type. The compiler then removes them when the code is built.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Use import type for type-only imports
Regular imports cause the JavaScript runtime to evaluate and execute the imported module even when only a TypeScript type from that module is used. This can increase bundle size, introduce unintended side effects, and create circular dependency issues that are otherwise avoidable. Using import type makes the erased-at-runtime nature of type imports explicit and enables bundlers and the TypeScript compiler to handle them optimally.
Quick Reference
- import type is erased entirely at compile time — no runtime module evaluation
- Prevents accidentally importing a value when only a type is needed
- Reduces circular dependency issues caused by type-only relationships
- verbatimModuleSyntax in TypeScript 5 enforces this automatically
Check
Review the import statements in this TypeScript file and identify any imports where only types or interfaces are used. These should use import type instead of a regular import.
Fix
Convert the identified regular imports to import type where the imported binding is only used as a TypeScript type annotation and not as a runtime value.
Explain
Explain the difference between import and import type in TypeScript, why type-only imports should be declared explicitly, and how verbatimModuleSyntax enforces this at the compiler level.
Code Review
Inspect all import statements in this file. For each import, check whether the imported name appears only in type positions (annotations, generics, implements clauses) versus runtime positions (function calls, new, typeof). Flag any regular import that is used only as a type.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/javascript/type-only-imports
FAQ
What does import type do?
It tells the compiler the import is erased at build time, so no runtime module is loaded.
What is verbatimModuleSyntax?
It is a TypeScript 5 setting that enforces this rule automatically, according to the skill.
Can this help with circular dependencies?
The skill says avoidable circular dependencies can be reduced by using type-only imports.
Details
Original description by the author
Use when auditing import statements in TypeScript files, setting up a new TypeScript project, or investigating unexpected bundle inclusions from type-only dependencies.
Popularity
- GitHub stars
- 75k
- Ranking position
- #3067
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.