My first, very idiosyncratic VS Code extension that perhaps only I will ever use! There are many excellent import sorters available -- sort-imports for example -- but
Automatically splits and sorts imports on save. You can disable this behavior in the settings and split'n'sort manually.
Imports are sorted case-sensitive and broken into 6 categories, in this order:
Of course, it is very rare for any code to use all these different
Change sort order so string imports come first
Extension activating for non-TypeScript files
After eating my own dog food for a while, it became clear that a case-insensitive sort is a Really Bad Idea! Lowercase exports are semantically different to uppercase exports: the former are typically functions and the latter classes. The two are now separated #1.
Developed by Mark Florence.
Many thanks to sort-imports for showing the way!
Special thanks to typescript-parser for a really nice and easy-to-use TypeScript to AST parser.