Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>Import WipeNew to Visual Studio Code? Get it now.
Import Wipe

Import Wipe

ovair

|
3 installs
| (0) | Free
Remove unused imports across every language — VS Code language tooling first, with built-in fallbacks for JS/TS, Python, Go, Java, Kotlin, Rust, Dart, PHP, C#, Swift, and more.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Import Wipe

Import Wipe Icon

Import Wipe removes unused imports across every programming language. It uses VS Code language tooling first, then falls back to built-in language-specific engines with conservative safety guards.

Supported Languages

Import Wipe works with any language that has a VS Code language server providing code actions. When a language server is unavailable, built-in fallback engines handle the following languages directly:

Language Fallback Engine
JavaScript / JSX ts-morph AST analysis
TypeScript / TSX ts-morph AST analysis
Python Lexical analysis (import / from ... import)
Go Lexical analysis (single & block imports)
Java Lexical analysis
Kotlin Lexical analysis
Scala Lexical analysis
Rust Lexical analysis (use statements, brace groups)
Dart Lexical analysis (as, show imports)
PHP Lexical analysis (use statements)
C# Lexical analysis (using statements)
Swift Lexical analysis
C / C++ Lexical analysis (#include, best-effort)
Ruby Lexical analysis (require / require_relative)
Elixir Lexical analysis (alias / import)
Haskell Lexical analysis (qualified & specific imports)

Features

  • Remove unused imports from the current file via right-click context menu or Command Palette
  • Remove unused imports in the entire project with cancellable progress and parallel batching
  • Undo last project wipe to restore all files changed by the last project-wide wipe
  • Auto-clean on save via importwipe.cleanOnSave
  • Safer project-wide execution: skips dirty files and very large files (> 2 MB) to avoid risky overwrites
  • Multi-tier engine for maximum reliability:
    1. Language server code actions (removeUnusedImports, organizeImports)
    2. Language-specific AST/lexical fallback when code actions are unavailable
  • Conservative fallback gate: for non-JS/TS languages, if language tooling returns import actions but chooses no changes, lexical fallback is skipped
  • Deterministic JS/TS cleanup: if TypeScript/JavaScript code actions no-op, Import Wipe still runs ts-morph fallback
  • Fast precheck path: files without import-like syntax are skipped early
  • Lazy-loaded internals — ts-morph is only loaded when actually needed
  • esbuild-bundled for fast activation and small install size

Usage

  1. Open a source file.
  2. Right-click in the editor and run:
    • Import Wipe: Remove Unused Imports (current file)
    • Import Wipe: Remove Unused Imports in Entire Project
  3. Or use Command Palette (Ctrl+Shift+P / Cmd+Shift+P) to run any Import Wipe command.
  4. To undo a project-wide wipe, run Import Wipe: Undo Last Project Wipe.

Commands

Command Description
Import Wipe: Remove Unused Imports Clean unused imports in the current file
Import Wipe: Remove Unused Imports in Entire Project Clean unused imports across the workspace
Import Wipe: Undo Last Project Wipe Restore all files changed by the last project wipe

Extension Settings

Setting Default Description
importwipe.cleanOnSave false Automatically remove unused imports each time a file is saved.

How It Works

Import Wipe uses a cascading strategy to maximize accuracy and language coverage:

  1. Code Actions: asks the active language server to remove unused imports. This is the most accurate approach and works with any language that has proper VS Code extension support (for example, Pylance for Python, gopls for Go, rust-analyzer for Rust).
  2. Language-specific fallback: if code actions are unavailable or ineffective, Import Wipe uses built-in engines tailored to each language. For JS/TS this uses full AST analysis via ts-morph. For Python, Go, Java, Rust, and others, it uses lexical analysis that strips strings and comments before scanning identifier usage.
  3. Safety gate: for non-JS/TS languages, if code actions are available and return import-cleanup candidates but make no changes, fallback removal is not forced.
  4. JS/TS reliability guard: when code actions do not modify a JavaScript/TypeScript file, Import Wipe runs ts-morph fallback to ensure unused imports are still removed.

Star/wildcard imports (for example, from x import *, import java.util.*) are preserved and never removed.

Release Notes

See CHANGELOG.md.

License

MIT. See LICENSE.

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