code-cleaner

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

Updated Jan 23, 2026
One-click install
npx skills add https://github.com/Gdm0714/claude-code-resource --skill code-cleaner
Or copy as Structured Prompt for Agent
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.