Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1K
Views
How do I delete all unused imports in the active file with one command in VS Code (typescript)?

Previously, I used to be able to do CMD+SHIFT+p > Organize imports and this would both sort and delete unused imports. This functionality seems to have broken.

How can I delete unused imports quickly with one command?

Current workaround is: click on unused import, CMD+. > Delete unused imports.

enter image description here

Languages for which this is applicable (typescript, typescriptreact, javascript, javascriptreact).

I have confirmed VS code is using a recent version of typescript unlike people in this post enter image description here

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

It turns out that Organize Imports does actually work as expected but it was conflicting with the Deno plugin.

I found this out by using the amazingly useful Extension Bisect feature which is built into Visual Studio Code. Extension Bisect disables half your extensions and asks you to check if the issue persists. This process is repeated until only a single extension is left. I strongly recommend trying it out via CMD+SHIFT+P > Start Extension Bisect

Turns out my issue is a duplicate of this GitHub issue.

about 4 years ago · Juan Pablo Isaza Report

0

There does not appear to be a built-in way to access the delete all imports functionality. But you can install the Remove Unused Imports extension

VS Code extension to remove unused ES6 imports inside JavaScript and TypeScript files (.js, .jsx, .ts and .tsx extensions) without changing the current order, as opposed to the built-in VS Code "Organize Imports" functionality.

and

try this keybinding:

{
  "key": "cmd+shift+r",            // or whatever you want
  "command": "remove-unused-imports.main",
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!