Organize Imports
organizeImportsSort, coalesce, and remove unused imports in TypeScript or JavaScript files. Uses TypeScript's native organizeImports to clean up import statements for files in a tsconfig.json project.
Instructions
Sort, coalesce, and remove unused imports in a TypeScript/JavaScript file. Uses TypeScript's native organizeImports with mode 'All' (sorts, coalesces, and removes unused). Requires the file to be part of a tsconfig.json project.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | File path (absolute or relative to cwd) | |
| preview | Yes | If true, only preview changes |