Reputation: 1750
In PhpStorm is it possible to have the auto formatter align consecutive assignments in JavaScript? The PHP formatter has the option to align on equals ("+") by checking the "Align consecutive assignments" option in Settings -> Code Style -> PHP -> Other(Tab), but there doesn't seem to be that option for JavaScript, just for colon assignments.
I am using PhpStorm 7.1.3, the latest at the time of writing.
Thanks.
Upvotes: 5
Views: 1456
Reputation: 1108
I am using phpstorm 2018.3.5 and I just had to configure this style of alignment for a project I took over.
As sam said here for php you can set it in :
Settings -> Editor -> Code Style -> PHP -> Wrapping and Braces -> Align consecutive assignments
So I thought it would be the same for JS but it turns out to be slightly different :
Settings -> Editor -> Code Style -> JavaScript -> Wrapping and Braces -> Variable Declarations -> Align -> When grouped
I hope this can help.
Upvotes: 6