Provide option to organize imports as part of format
See original GitHub issueHeader added by @mjbvz
TypeScript Version: 4.4.2
Search Terms
- format / formatting / formatter
- organize imports / sort imports
This feature request is to provide a new option that would automatically run organize imports
as part of format.
While VS Code could implement this itself today, handling this on the TS Server would have a few key advantages:
- It would let us edit the document in a single go. Otherwise we have to first format the document and then organize imports. This would cause some flickering and may result in multiple undo stops
- Other consumers of TS could benefit from the feature
Testing microsoft/vscode#48150
This would be awesome.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:15
- Comments:8 (3 by maintainers)
Top Results From Across the Web
vsc-organize-imports - Visual Studio Marketplace
Open Visual Studio Code's command bar (ctrl+shift+p); Write: 'vsc Organize Imports'; Press Enter to execute the organize. Extension Settings.
Read more >How to Automatically Organize Imports in VSCode - YouTube
Learn how to organize your imports when you save a file in VSCode----If you like cooking, checkout my side project: ...
Read more >IntelliJ IDEA code reformat options - Stack Overflow
In IDEA 2018, you can hit Ctrl + Alt + Shift + L and the reformat file pop-up will appear. Then you can...
Read more >Auto import | IntelliJ IDEA Documentation - JetBrains
Press Ctrl+K or select Git | Commit from the main menu. · Click Show Commit Options and in the Before commit area, select...
Read more >format-imports - npm
format -imports [options] [FILE1 FILE2 ...] This command formats a number of given files. If no files provided, it'll read the source from ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi guys
It is really annoying that my prettier have conflict with auto organize imports. @mjbvz Could you please tell if you have any progress on it?
As workaround I use
to give prettier a chance to make correct formatting.
Would love this action to happen before formatting, since may users use
prettier
. Currently, I organize imports (which does not respect prettier formatting rules) and then format with prettier (manually or onSave)