Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>Clear and CleanNew to Visual Studio Code? Get it now.
Clear and Clean

Clear and Clean

Code With Chandra

|
13 installs
| (0) | Free
Remove console.log statements and comments from your code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Clear and Clean VS Code Extension

A powerful VS Code extension that helps you clean up your code by removing console.log statements and comments across multiple programming languages.

Features

🧹 Remove Console Logs

  • Removes console.log() statements (single and multi-line)
  • Supports various console methods: log, warn, error, info, debug, trace
  • Handles complex multi-line console statements

Examples of what gets removed:

console.log("simple log");
console.log(
    "multi-line log"
);
console.warn("warning message");
console.error("error message");

💬 Remove Comments

  • Supports multiple programming languages
  • Removes both single-line and multi-line comments
  • Language-specific comment detection

Supported Languages:

  • JavaScript/TypeScript: // and /* */
  • Python: # and """ or ''' docstrings
  • Java/C#/C++: // and /* */
  • HTML/XML: <!-- -->
  • CSS/SCSS: /* */
  • SQL: -- and /* */
  • Shell/Bash: #
  • And many more...

🚀 Remove Both

  • Clean up both console logs and comments in one command

Usage

Command Palette

  1. Open Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
  2. Search for:
    • Clear & Clean: Remove Console Logs
    • Clear & Clean: Remove Comments
    • Clear & Clean: Remove Console Logs & Comments

Context Menu

Right-click in any editor and select from the context menu:

  • Remove Console Logs
  • Remove Comments
  • Remove Console Logs & Comments

Installation

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "Clear and Clean"
  4. Click Install

Example

Before:

// This is a comment
function calculateSum(a, b) {
    console.log("Calculating sum of", a, "and", b);
    /* 
     * Multi-line comment
     * explaining the logic
     */
    const result = a + b;
    console.log(
        "Result is:",
        result
    );
    return result;
}

After running "Remove Console Logs & Comments":

function calculateSum(a, b) {
    const result = a + b;
    return result;
}

Requirements

  • VS Code 1.54.0 or higher

Contributing

If you find any issues or want to contribute, please visit our GitHub repository.

License

This extension is licensed under the MIT License.


Enjoy coding with cleaner code! 🎉

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