How to Automatically Organize Imports in VSCode

preview_player
Показать описание
Learn how to organize your imports when you save a file in VSCode

----

----

----

----
Follow Me Online Here:

#benawad

----
#benawad
Рекомендации по теме
Комментарии
Автор

Code snippet
"editor.codeActionsOnSave": {
"source.organizeImports": true,
},

harm
Автор

Thank you so much!!
In case this doesn't work, you can use the default shortcut to organize imports:
"Shift + Alt + O" on PC
"option + shift + o" on MAC

kunal_chand
Автор

As some one who has suffered fro manually fixing these imports, this is a lifesaver. Rock on, Ben

RaoVenu
Автор

Within 2 min you've saved tons of our time and made a world better.

dragonattack
Автор

Duuude, thanks! Ive been avoiding additional plugins for this interaction, the fact that VsCode does it natively is a huge plus.

teytag
Автор

Thanks a ton. I was looking for VScode extensions but this is so much better. Is there any way I can separate node module import, absolute imports and relative imports by an extra line in between them?

rahulgupta
Автор

Just looked for that yesterday. Love it. Thanks so much!

DavidRoyer
Автор

Awesome Man🙌🏼. So VS Code has built-in solution☑

vahidseyidov
Автор

Awesome stuff man, You making life easier

BNgema
Автор

I have to say you save me at least 30 min. Thank you!

xushenxin
Автор

Can a special rule be made to keep the React import on top?

zomars
Автор

thanks bro your video solve my difficult problem

sohailkhan
Автор

Thanks for the tip. QQ: How to automatically organize imports for all the files inside the project, without having to open each file and hitting save?

siddharthgolchha
Автор

You have probably said before, but I cant find it anywhere... have you just customised certain parts of the standard theme? or is it an extension? :) thanks a lot

benlong
Автор

On a Mac, Option + Shift + O to organize imports.

ZachBugay
Автор

Can we customize how imports are organized?

wojciechniedzwiedz
Автор

SO MUCH I WANNA TURN OFF THIS SHIT SO MUCH FINALLY AFTER I FUCK AROUND LIKE 3HROUS FOR NOTHING

태평-mw
Автор

Try mentioning the language used in your future videos, not everyone codes in js/ts lol

federinik