Console None - VS Code Extension
A powerful VS Code extension that helps you remove console.log statements from your codebase with granular control.
Features
- File-by-file processing: Remove console.logs from individual files
- Workspace-wide processing: Remove console.logs from your entire codebase
- Granular control: Choose to keep, remove, or selectively remove console.log statements
- Multiple console methods: Supports
console.log , console.warn , console.error , console.info , console.debug , console.trace , console.table , console.group , console.groupEnd , console.time , console.timeEnd , console.count , and console.assert
- File type support: Works with JavaScript, TypeScript, JSX, TSX, Vue, and Svelte files
- Smart detection: Intelligently handles console statements with proper parentheses matching
- Preview functionality: View all console.log statements before removing them
Commands
Remove Console Logs from Current File
- Command:
Console None: Remove Console Logs from Current File
- Shortcut:
Ctrl+Shift+R (Windows/Linux) or Cmd+Shift+R (Mac)
- Description: Removes console.log statements from the currently active file
Remove Console Logs from Workspace
- Command:
Console None: Remove Console Logs from Workspace
- Description: Removes console.log statements from all supported files in the workspace
Show Console Logs in Current File
- Command:
Console None: Show Console Logs in Current File
- Description: Displays all console.log statements in the current file and allows navigation to them
Show Console Logs in Workspace
- Command:
Console None: Show Console Logs in Workspace
- Description: Shows all console.log statements across the workspace, grouped by file
Usage
Removing Console Logs from a Single File
- Open the file you want to process
- Run the command
Console None: Remove Console Logs from Current File or use the keyboard shortcut
- Choose your action:
- Remove All: Removes all console.log statements from the file
- Select Individual: Allows you to choose which specific console.log statements to remove
- Keep All: Cancels the operation
Removing Console Logs from the Entire Workspace
- Run the command
Console None: Remove Console Logs from Workspace
- Choose your action:
- Remove All: Removes all console.log statements from all supported files
- Select by File: Allows you to choose which files to process
- Keep All: Cancels the operation
Previewing Console Logs
- Use
Console None: Show Console Logs in Current File to see all console.log statements in the current file
- Use
Console None: Show Console Logs in Workspace to see all console.log statements across the workspace
- Click on any console.log statement to navigate to it in the editor
Supported File Types
.js - JavaScript files
.ts - TypeScript files
.jsx - React JSX files
.tsx - React TypeScript JSX files
.vue - Vue.js files
.svelte - Svelte files
Installation
- Clone this repository
- Run
npm install to install dependencies
- Run
npm run compile to build the extension
- Press
F5 to run the extension in a new Extension Development Host window
Development
Prerequisites
- Node.js
- VS Code
- TypeScript
Building
npm install
npm run compile
Running in Development
- Open this folder in VS Code
- Press
F5 to run the extension in a new Extension Development Host window
- Test the extension functionality
Watching for Changes
npm run watch
How It Works
The extension uses regex pattern matching to identify console statements in your code. It:
- Scans files for console method calls
- Handles nested parentheses properly
- Provides options for selective removal
- Maintains code formatting when removing statements
- Skips common directories like
node_modules , .git , dist , etc.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
License
MIT License - see LICENSE file for details
| |