code-cleaner

Remove unused imports, console logs, and dead variables from JavaScript/TypeScript projects.

Updated Jan 23, 2026
Ready to run
npx skills add https://github.com/Gdm0714/claude-code-resource --skill code-cleaner
πŸ’¬ Prompt for ChatGPT / Claude Chatβ–Ό
Please help me install this Agent Skill.
Skill: code-cleaner
Source: https://github.com/Gdm0714/claude-code-resource/tree/main/skills/code-cleaner
Command: npx skills add https://github.com/Gdm0714/claude-code-resource --skill code-cleaner

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

ESLintλ₯Ό μ‚¬μš©ν•΄ μ½”λ“œλ² μ΄μŠ€μ—μ„œ λΆˆν•„μš”ν•œ import, console 둜그, μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” λ³€μˆ˜λ₯Ό μžλ™μœΌλ‘œ μ œκ±°ν•΄ 개발 속도와 μ½”λ“œ ν’ˆμ§ˆμ„ λ†’μž…λ‹ˆλ‹€.

Core Features & Use Cases

  • μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” import μžλ™ 제거
  • console.log/warn/error 제거
  • μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” λ³€μˆ˜ 탐지 및 제거
  • 쀑볡 import 정리
  • Git hook으둜 컀밋 μ „ μžλ™ μ‹€ν–‰
  • VS Code μ €μž₯ μ‹œ μžλ™ 정리

Quick Start

ESLint의 μžλ™ μˆ˜μ •(lint:fix)을 μ‹€ν–‰ν•΄ μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” import와 console 둜그, μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” λ³€μˆ˜λ₯Ό μžλ™μœΌλ‘œ μ œκ±°ν•©λ‹ˆλ‹€.

Frequently Asked Questions about code-cleaner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically remove unused imports and console logs in TypeScript?β–Ό

To automatically remove unused imports and console logs in TypeScript, you can use ESLint's auto-fix functionality. This process identifies and deletes dead variables, duplicate imports, and console statements to clean up your codebase during refactors or pre-commit checks.

Can I use ESLint to enforce a production no-console policy?β–Ό

Yes, you can use ESLint to enforce a production no-console policy by automatically removing console.log, console.warn, and console.error statements. This ensures your production build remains clean without requiring manual log deletion.

How do I set up a pre-commit hook for code cleanup?β–Ό

Setting up a pre-commit hook for code cleanup involves configuring a Git hook to run ESLint's lint:fix command before commits. This automatically prunes unused imports and dead variables, ensuring only clean code enters your repository.

Does ESLint preserve intentionally ignored variables during code cleanup?β–Ό

Yes, ESLint preserves intentionally ignored variables during code cleanup if they are prefixed with an underscore. This allows you to retain specific unused variables for future use while still removing other dead code and unused imports.

What is the best way to clean up dead code in a JavaScript project?β–Ό

The best way to clean up dead code in a JavaScript project is applying ESLint auto-remediation alongside Prettier. This combination automatically detects and prunes unused imports, console logs, and dead variables to streamline code reviews and refactoring.

Why does ESLint not remove my unused variables during lint fix?β–Ό

ESLint might not remove your unused variables during lint fix if they are prefixed with an underscore, which marks them as intentionally ignored. Otherwise, ensure your ESLint configuration targets dead variable removal for your JavaScript or TypeScript files.