Javascript multi-line variable declarations and code formatter

I am new to WebStorm, and it seems to have endless options for formatting JavaScript code, but one thing it appears to be missing is a way to control how long variable declarations are formatted.

ex:

function something() {
    var myVar, myOtherVar, yetAnotherVar = 3;
}


Could get reformatted to:

function something() {
    var myVar,
        myOtherVar,
        yetAnotherVar = 3;
}


Am I missing something here?

4 comments
Comment actions Permalink

Sorry, I guess I should've searched through the bug list first. Good news, thank you!

0
Comment actions Permalink

@liubov The issue discussed here doesn't relate to the links you provided. WEB-884 is about indentation alignment, this question was about splitting a var declaration over multiple lines.

As far as I can see we don't have the option to do that anywhere.

0
Comment actions Permalink

the feature you are looking for will be available in 2017.1 - see https://youtrack.jetbrains.com/issue/WEB-12581#comment=27-1889709

0

Please sign in to leave a comment.