I have been working with Angular 4x and TypeScript in Webstorm a lot lately and have been guilty of the occasional sloppy import statement. If you found this article, you are probably doing the same thing. Because adding spaces between the import and braces is super tedious, I took some time to find a solution.
I can’t take all of the credit for this. Some awesome people posted the solution for JS imports on stackoverflow. At the very minimum, I am creating this post so I have something to reference later on as well.
Add Spaces Between Import and Braces in Webstorm Settings
- Open Settings:
File > Default Settings
- Expand Editor Menu on Left
- Expand Code Style Menu under Editor Menu
- Click JavaScript or TypeScript if you are using TypeScript
- Click on the Spaces Tab in the right content area
- Scroll Down to
Within
Settings - Select
ES6 import/export braces
- Click
Apply
andOk
to close
Enjoy looking at clean, consistent imports!
Alex Kopen says
GREAT blog post, Ryan 🙂 I sure was getting sick and tired of manually cleaning up my imports!
Danny Snell says
Wow! This is a life saver. Thanks R-Dawg!
hello says
Awesome post!
KKV says
Thank you very much