Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>ImportLensNew to Visual Studio Code? Get it now.
ImportLens

ImportLens

SAMARTHA H V

|
11 installs
| (0) | Free
Intelligent import management with AST-based analysis, organization, and CI/CD integration
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

ImportLens Logo

NPM VS Code Marketplace

Clean unused imports across multiple languages in VS Code and CI/CD.

Detects and removes unused imports using AST analysis for TypeScript/JavaScript and LSP for other languages. Features symbol-level precision, baseline tracking, and historical trend visualization.

Features

Multi-Language Support • Safe Mode • Symbol-Level Precision • Baseline Tracking • Historical Trends • Visual Dashboard

Supported Languages:

🟦 TypeScript/JavaScript • 🐍 Python • ☕ Java • 🔵 Go • 🦀 Rust • ⚙️ C/C++

Plus 50+ additional languages via Language Server Protocol (LSP) support

Installation

VS Code: Extensions → Search "ImportLens" → Install

CLI: npm install -g importlens

Usage

VS Code Extension

Ctrl+Shift+P → ImportLens: Clean Current File

CLI Tool

# Check for unused imports
importlens-cli --check src/

# Auto-fix with safe mode
importlens-cli --fix --safe-mode src/

# Baseline workflow (CI/CD)
importlens-cli --baseline-generate src/
importlens-cli --check src/
importlens-cli --baseline-update src/

Example

// Before
import React from 'react';
import { useState, useEffect } from 'react';
import './styles.css';

// After (Safe Mode)
import React from 'react';
import './styles.css';

CI/CD Integration

GitHub Actions:

- name: Check unused imports
  run: |
    npm install -g importlens
    importlens-cli --check --format=github src/

Output Formats: text • json • github • junit

Configuration

VS Code: settings.json

{
  "importlens.enableOnSave": true,
  "importlens.safeMode": true,
  "importlens.showStatusBar": true
}

CLI: .importlensrc.json in project root

Documentation

  • User Guide - Complete usage instructions
  • Architecture - Technical design
  • Vision - Project roadmap
  • Contributing - Development guide

License

MIT © 2025 ImportLens Contributors

Links: GitHub • Issues • NPM • VSCODE

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