ts-auto-import-organizer is a Visual Studio Code extension designed to automatically organize import statements in TypeScript and TypeScript React files. This extension helps maintain clean and organized import statements by removing unused imports and sorting the remaining ones.
Features
Automatically organize import statements on text document change.
Manually trigger import organization using a command.
Customizable delay for automatic import organization.
Installation
Open Visual Studio Code.
Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or by pressing Ctrl+Shift+X (Windows) or Cmd+Shift+X (macOS).
Search for ts-auto-import-organizer.
Click on the Install button.
Usage
Command
To manually organize imports:
Open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS).
Type Organize Imports and select the ts-auto-import-organizer: Organize Imports command.
Automatic Organization
To enable automatic import organization, configure the settings in your settings.json file: