← Back to list

fix-unused-imports
by inernoro
⭐ 1🍴 1📅 Jan 24, 2026
SKILL.md
name: fix-unused-imports description: Automatically detect and fix TypeScript unused imports/variables errors (TS6133). Use when encountering "declared but its value is never read" errors during tsc, build, or CI checks.
Fix Unused Imports
Automatically detect and remove unused imports/variables in TypeScript/JavaScript projects.
When to Use
This skill should be invoked when:
tsc --noEmitfails with TS6133 errors- Build or CI fails due to unused import/variable errors
- User asks to fix unused imports or clean up imports
Execution Steps
-
Identify the error: Parse the TypeScript error message to extract:
- File path
- Line number
- The unused identifier name
-
Read the file: Use the Read tool to examine the file content around the error line.
-
Determine the fix strategy:
- Single import: If the line is
import { Foo } from 'module';andFoois unused, delete the entire line. - Multiple imports: If the line is
import { Foo, Bar, Baz } from 'module';and onlyBaris unused, remove justBarfrom the import list. - Unused variable: If it's a variable declaration, consider if it should be removed or prefixed with
_.
- Single import: If the line is
-
Apply the fix: Use the Edit tool to remove or modify the unused import/variable.
-
Verify: Re-run
tsc --noEmitor the original command to confirm the fix.
Example Error Patterns
src/pages/Example.tsx(24,3): error TS6133: 'ChevronRight' is declared but its value is never read.
Parse this as:
- File:
src/pages/Example.tsx - Line: 24
- Identifier:
ChevronRight
Fix Patterns
Single Unused Import (delete entire line)
// Before
import { UnusedComponent } from './components';
// After
// (line deleted)
One of Multiple Imports (remove from list)
// Before
import { Used, Unused, AlsoUsed } from './components';
// After
import { Used, AlsoUsed } from './components';
Type-only Import
// Before
import { type UnusedType, UsedType } from './types';
// After
import { UsedType } from './types';
Batch Processing
When multiple TS6133 errors exist:
- Collect all errors from the TypeScript output
- Group by file to minimize file reads
- Fix all issues in each file before moving to the next
- Re-verify after all fixes
Commands to Detect Issues
# For prd-admin
cd prd-admin && pnpm tsc --noEmit
# For prd-desktop
cd prd-desktop && pnpm tsc --noEmit
# Full CI check
./quick.sh ci
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon