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");
- 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
- Open Command Palette (
Ctrl+Shift+P
or Cmd+Shift+P
)
- Search for:
Clear & Clean: Remove Console Logs
Clear & Clean: Remove Comments
Clear & Clean: Remove Console Logs & Comments
Right-click in any editor and select from the context menu:
- Remove Console Logs
- Remove Comments
- Remove Console Logs & Comments
Installation
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X
)
- Search for "Clear and Clean"
- 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
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! 🎉