WebStorm code style - Function definition - Keep one-liner if body empty Follow
Plop!
When creating dummy functions, with an empty body, I would like them to look like that:
start : function() {},
pause : function() {},
However, WebStorm reformats them this way:
start : function() {
},
pause : function() {
},
It is fine for every other case, but I don't like it when the functions have an empty body.
Is there any way to configure WebStorm in accordance with this wanted behavior?
Thanks again.
Please sign in to leave a comment.
Code Style/JavaScript/Wrapping and Braces, Keep when reformatting/Simple methods in one line
@Elena
I would like to keep only empty functions in one line, not simple functions.
It also doesn't apply to classes:
for classes, please try "Keep when reformatting > Simple blocks in one line"
If you need a separate option for functions with empty body, please feel free to create a request in youtrack, https://youtrack.jetbrains.com/issues/WEB
@Elena
Thanks for the tip, but it only works if the class is not being exported.
Elena Pogorelova's answer works now!