Support customization of where type imports are placed in organize/sort imports #52820
Labels
Domain: Organize Imports
Issues with the organize imports feature
Experience Enhancement
Noncontroversial enhancements
Fix Available
A PR has been opened for this issue
Suggestion
An idea for TypeScript
Milestone
Filing this so I don't forget about it; after #52115, we allow (though, do not fully expose support for) the ability to customize the sort order used by organize/sort/auto imports.
The intent is that we are able to match commonly used linters / formatters, leading towards fewer errors and edits needed to reach the "final state" of a file. e.g., instead of inserting an import at the end, then needing a linter to move it, we could just put it in the right place. Or, if you accidentally (or intentionally!) run Organize Imports, it should be possible to configure it such that it doesn't do anything.
This is mostly working already, however, our sort always puts type imports at the end. This differs from
eslint-plugin-simple-import-sort
anddprint
, which ignore thetype
keyword and sort things that way (lydell/eslint-plugin-simple-import-sort#124).We should be able to add a new configuration which controls this behavior.
I have half a change for this sitting in a branch already, but it still needs some work.
The text was updated successfully, but these errors were encountered: