-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 'Organize Imports' feature #10020
Comments
Personal Opinion: Nice idea for quickfixes / additional refactorings to be added into release 2.1 : https://github.com/Microsoft/TypeScript/wiki/Roadmap#21 🌹 |
I'd love to see this implemented. |
It would be also nice if this feature respects |
would be awesome if it could unite imports, too. from
to
|
It would also be great if this feature alphabetized both the objects inside the So this: import { Foo, Bar } from './banana';
import { Dog, Cat } from './apple'; becomes this: import { Cat, Dog } from './apple';
import { Bar, Foo } from './banana'; |
TSLint has a rule for this: |
It'd be nice if it were inserted in order in the first place so it didn't require the extra auto-fix steps |
Right now sort will put the imports on top of the document, and it moves the comments / copyright / author info to the bottom of imports. Is there a way to preserve the comments on top of the document? |
@jbrownson, sort on import is covered by #16119. |
@madhugb How are you sorting? I didn't think any of the editors had shipped a version consuming the new |
@niklas-dahl I believe that was covered by #21909. |
@akosyakov at present, we're retaining module specifiers as-is. Would you mind filing a new issue suggesting they be simplified when possible? |
Also note that adding missing imports is being handled separately using code fixes (which should support fix-all). |
@amcasey Are you referencing to shortening imports? As now it works quite nicely for us, except when imports are inserted as |
It should:
The text was updated successfully, but these errors were encountered: