Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>clean-unused-filesNew to Visual Studio Code? Get it now.
clean-unused-files

clean-unused-files

Manish Singh

|
51 installs
| (1) | Free
VS Code extension that analyzes a project's file structure, checks for unused files, and moves them to a separate folder
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VS Code Extension - Unused File Cleaner

📌 Overview

This Visual Studio Code extension scans your project to identify unused files, including images, CSS, and JavaScript files. Instead of deleting them, it moves unused files to a separate folder so you can review them manually.


✨ Features

  • Scans HTML, PHP, CSS, and JS files for file references.
  • Detects unused CSS, JS, PNG, JPG, JPEG, GIF, SVG, WEBP files.
  • Moves unused files to an unused_files folder instead of deleting them.
  • Ensures referenced files inside nested directories are also checked.

🛠 Installation

1️⃣ Install from VSIX File

If you have the packaged .vsix file, install it manually:

code --install-extension unused-file-cleaner.vsix

Or manually in VS Code:

  1. Open VS Code.
  2. Go to Extensions (Ctrl + Shift + X).
  3. Click on the three-dot menu (⋮) > Install from VSIX....
  4. Select your .vsix file.

🚀 How to Use

  1. Open your project folder in VS Code.
  2. Press Ctrl + Shift + P and search for Clean Unused Files.
  3. Run the command.
  4. If unused files are found, they will be moved to the unused_files folder.
  5. Review them manually before deleting.

🔄 Development & Running Locally

1️⃣ Clone the Repository

git clone https://github.com/your-repo/unused-file-cleaner.git
cd unused-file-cleaner

2️⃣ Install Dependencies

npm install

3️⃣ Run the Extension Locally

npm run compile
code .
  1. Press F5 to launch a new VS Code window with the extension loaded.
  2. Test the extension in the new window.

📦 Packaging the Extension

To package your extension as a .vsix file, run:

npm install -g @vscode/vsce
vsce package

This will generate unused-file-cleaner.vsix.


⚠️ Notes

  • This extension does not delete files automatically. It only moves unused files to the unused_files folder.
  • Ensure that your project is fully indexed before running the command.
  • If a file is used dynamically (e.g., in JavaScript or PHP), the extension may not detect it. Always review before deleting.

📝 License

MIT License.


💡 Contributions

Feel free to fork this repo and submit a PR if you find a bug or have improvements!


🚀 Happy Coding!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft