Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1K
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda