Smart Console Remover
A VS Code extension to remove or comment out console.log
statements in JavaScript and TypeScript files.
Features
✅ Remove all console.log
statements
✅ Comment out console.log
instead of removing
✅ Uncomment previously commented logs
✅ Supports multi-line console statements
✅ Supports custom logger patterns (e.g., logger.log
, winston.info
)
✅ Works with JavaScript, TypeScript, React, Vue, Angular, and other frameworks
Usage
- Right-click in a JavaScript/TypeScript file and select:
- "Remove Console Logs"
- "Comment Console Logs"
- "Uncomment Console Logs"
2️⃣ Using Command Palette (Ctrl+Shift+P
)
- Search for:
Remove Console Logs
Comment Console Logs
Uncomment Console Logs
Examples
1️⃣ Remove Console Logs
Before:
console.log("Debugging info:", data);
console.warn("This is a warning!");
console.error("Error detected!");
logger.log("Hello");
After:
// All console logs are removed!
Before:
console.log("Fetching data...");
console.log("Data received:", response);
logger.log("Hello");
After:
// console.log("Fetching data...");
// console.log("Data received:", response);
// logger.log("Hello");
3️⃣ Handle Multi-line Console Statements
Before:
console.log(
"Multiline",
"console statement"
);
After:
// console.log(
// "Multiline",
// "console statement"
// );
Before:
// console.log("Fetching data...");
// console.warn("Something went wrong!");
// logger.log("Hello");
After:
console.log("Fetching data...");
console.warn("Something went wrong!");
logger.log("Hello");
Installation
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X
)
- Search for Smart Console Remover
- Click Install
Configuration
No additional configuration is needed. The extension automatically detects JavaScript and TypeScript files.
Contributing
Contributions are welcome! Feel free to open issues or PRs on GitHub.
License
MIT License