Formatting array function argument in Webstorm

I have this piece of code:

async.parallel(

    [

        function(callback) { },

        function(callback) { }

    ],

    function(err) { if(err) throw err; }

);

 

I'd like to not take up two levels of indentation for the array elements. Ideally it would like to keep the array beginning brace on the same line as the function arguments opening brace, like this:

async.parallel([

    function(callback) { },

    function(callback) { }

], function(err) { if(err) throw err; });

 

 

But when I do that, it is automatically formatted to even further indentation:

async.parallel([

                           function(callback) { },

                           function(callback) { }

                       ], function(err) { if(err) throw err; });

 

I've messed with the settings in code style for a while now and I don't see a place to set this.

2 comments
Comment actions Permalink

Here is the formatting I get when using 'Default' code style:

 

what is wrong with it? It doesn't look over-indented

0
Comment actions Permalink

Well that solves it for me.

I'm not sure what I changed from the default style but i was using Default (1). So I guess I changed something a while ago and now I can't remember what it was or find it to change it back.

Thank you!

0

Please sign in to leave a comment.