How to invoke the "Organize imports" TypeScript feature in Visual Studio?

Visual Studio Code has released a new feature in April last year which enable to organize imports on save. Can you try to update your current settings.json with the following changes:

"editor.formatOnSave": true,
"[typescript]": {
    "editor.codeActionsOnSave": {
        "source.organizeImports": true
    }
}

Hopefully this can be helpful and good luck!


This feature has now been added to Visual Studio 2017.

One can invoke it the following ways:

  1. Pressing Ctrl+R followed by Ctrl+G.
  2. Right-click in the code window and click Organize Imports in the context menu.

You can also use the following shortcut with your keyboard to "Organize imports":

Shift+Alt+O