Optimize imports (Alt-Ctrl-O) removes unused imports and merges imports from the same module into one statement.
And it can also sort imports by the module name – enable this option in the Imports section of the IDE Code Style settings. #WebStormTippic.twitter.com/Ps0op5g3on
-
-
Replying to @WebStormIDE
If Organize Imports could use a project's ESLint "sort-imports" rule (when set), that would be amazing.pic.twitter.com/0UZ5V8O9XI
1 reply 0 retweets 0 likes -
Replying to @stevensacks
Sorry, right now we can only sort imports by the module name and we don't plan to add more options at the moment.
1 reply 0 retweets 1 like -
Replying to @WebStormIDE @stevensacks
It's pretty interesting that ESLint decided to distinguish between imports with single and multiple symbols and not between imports from files and node modules or between named and default imports...
1 reply 0 retweets 1 like -
Replying to @WebStormIDE
I personally think that organizing imports by alphanumeric makes the most sense because I’m a human being and alphanumeric sorting is the most natural and effortless way to sort (and find) names. It’s really irrelevant where the import came from.
1 reply 0 retweets 1 like -
Replying to @stevensacks
This we can do actually. If you have 'sort-imports' option enabled in your ESLint config file, WebStorm will enable alphanumeric sorting when ESLint code style rules are applies.
2 replies 0 retweets 0 likes
We do apply rules from more simple ESLint configs automatically, but if the config is more complex (has "extends", written in JS), you need to run "Apply ESLint code style rules" action to update the IDE code style settings.pic.twitter.com/74OTyFEszs
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.