一键导入
ts-prune
Find and remove unused TypeScript imports. Use when auditing TypeScript/JavaScript projects to identify dead code and clean up import statements.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Find and remove unused TypeScript imports. Use when auditing TypeScript/JavaScript projects to identify dead code and clean up import statements.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Count lines of code, blank lines, comment lines, and files by language. Use when quickly assessing the size, complexity, and composition of a repository during an audit.
Python dependency health checker. Use to audit Python projects for missing dependencies, unused imports, transitive dependencies, and other dependency-related issues.
Official Go vulnerability scanner by the Go team. Use when auditing Go repositories to check for known vulnerabilities in dependencies using the Go vulnerability database.
Static code analysis tool for finding bugs and security issues. Use when auditing code quality, detecting OWASP vulnerabilities, or running custom code pattern matching across Python, Go, TypeScript, and many other languages.
Security vulnerability scanner for containers and code. Use when auditing a repository for known CVEs, security issues in dependencies, or supply-chain risks. Supports Python, Go, Node.js, Docker images, and more.
Query official library/framework documentation. Use when looking up API references, usage examples, or official best practices for a specific library or framework. Invoke when analyzing code that uses unfamiliar dependencies.
| name | ts-prune |
| description | Find and remove unused TypeScript imports. Use when auditing TypeScript/JavaScript projects to identify dead code and clean up import statements. |
# Run in project root
ts-prune
# Run in specific directory
ts-prune --dir ./src
# Dry run (show what would be removed)
ts-prune --dry-run
# Output formats
ts-prune --format table # human-readable (default)
ts-prune --format json # JSON output
ts-prune --format csv # CSV output
# Remove unused imports (interactive)
ts-prune --remove
# Skip specific modules
ts-prune --ignore=node_modules,dist,.next
| Field | Description |
|---|---|
file | File path with unused import |
import | The unused import statement |
type | "import" or "type" |
import statements in a codebase# JSON output for parsing
ts-prune --format json > ts-prune.json
# Dry run to see what can be cleaned
ts-prune --dry-run
# Remove unused imports (careful — backup first)
ts-prune --remove
ts-prune works on TypeScript projects. For JavaScript-only projects, use depcheck instead.