Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support customization of where type imports are placed in organize/sort imports #52820

Open
jakebailey opened this issue Feb 17, 2023 · 0 comments
Assignees
Labels
Domain: Organize Imports Issues with the organize imports feature Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript

Comments

@jakebailey
Copy link
Member

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 and dprint, which ignore the type 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.

@jakebailey jakebailey added Suggestion An idea for TypeScript Domain: Organize Imports Issues with the organize imports feature Experience Enhancement Noncontroversial enhancements labels Feb 17, 2023
@jakebailey jakebailey self-assigned this Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Organize Imports Issues with the organize imports feature Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

1 participant