Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>CleanserNew to Visual Studio Code? Get it now.
Cleanser

Cleanser

Ahmad Saad

|
7 installs
| (0) | Free
Remove comments and console logs with a single click.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Cleanser

A VSCode extension that helps you remove comments and console logs from your code files. This extension supports JavaScript, TypeScript, React, CSS, HTML, and Python files.


Features

  • Remove comments from various file types

  • Remove both comments and logs at once

  • Works on single files or all files in the workspace

  • Preserves code structure and formatting

  • Undo changes per file using VSCode's undo functionality


Usage

Working on a Single File

  1. Open the file you want to process

  2. Right-click in the editor

  3. Choose one of these options:

    • "Remove Comments (Current File)"

    • "Remove Console Logs (Current File)"

    • "Remove Comments and Logs (Current File)"


Working on All Files

  1. Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux) to open the command palette

  2. Type one of these commands:

    • "Remove Comments (All Files)"

    • "Remove Console Logs (All Files)"

    • "Remove Comments and Logs (All Files)"


Example

Before:


// This is a test function

function  example()  {

// This is a comment inside a function

console.log('This is a test log');

/* This is a multi-line

comment */

console.debug('Debug message');

// Another comment

    return  true;

}


After:


function  example()  {

    return  true;

}


Contributing

I appreciate all contributions, feel free to submit a pull request!

Check out the repository here.


License

This extension is licensed under the MIT License - see the LICENSE file for details.

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