WebStorm 6 Auto Formatting Code Animated Sublime Text Alignment Plugin

I am a long-term user of Sublime Text, but recently downloaded WebStorm 6 (6.0.2), and I really like it, but I could not find a plugin that matches the Sublime Alignment plugin that formats my code, which I use widely (yes, I'm a little fanatical regarding my code formatting).

For example, in Sublime, I can take this block of code:

user : { name : "Bruce Wayne", alias : "Batman", favColour : "black", dob : "unknown" } 

And after using the Alignment keyboard shortcut, it will be:

 user : { name : "Bruce Wayne", alias : "Batman", favColour : "black", dob : "unknown" } 

I looked at the option "Convert code" ( Code > Reformat Code... ), but in this case it does nothing for formatting, since Webstorm believes that it is already formatted correctly, which is actually quite right, just not my personal standards.

So my question is: is there a (fairly) easy way to achieve this, or is there a plugin that you know about available for WebStorm that offer the same / similar features?

Thanks in advance!

+4
source share
1 answer

Code formatting settings configured to Settings (Preferences on Mac) | Code Style | JavaScript Settings (Preferences on Mac) | Code Style | JavaScript Settings (Preferences on Mac) | Code Style | JavaScript Reformat Code is simply a command that reformats the selection / file according to these rules.

The code style for JavaScript has the ability to do this alignment:

  • "Spaces" tab | Other | Before property name-value separator ':' "Spaces" tab | Other | Before property name-value separator ':' - checked
  • "Other" tab | Align object properties "Other" tab | Align object properties = On colon
+9
source

Source: https://habr.com/ru/post/1488721/


All Articles