typescript-go
typescript-go copied to clipboard
Organize imports for TypeScript and JavaScript
In this PR:
- Port organize imports functionality for TypeScript and JavaScript
- Preserve blank line groupings to respect user's logical organization
- Support all import types: side-effect, type-only, namespace, default, named, and require
Imports are sorted by:
- Module type: absolute imports before relative imports
- Import kind: side-effect → type-only → namespace → default → named → require
- Alphabetically within each category
The feature is exposed via LSP workspace/executeCommand with command typescript-go.organizeImports and integrated into the VS Code extension as the "Sort Imports" command.
Fixes #1724