Intellij Formatting variable declarations
Asked Answered
D

2

14

Does intellij have an option to align javascript variable declarations like so

var x     = "x",
    yyyy  = "y";  

Note that the = are aligned neatly. I can't find an option to do that....worse, if I do it by hand, and then format the file, I lose the alignment on the =.

Durstin answered 9/11, 2011 at 16:33 Comment(0)
N
11

IDEA11 can definitely align javascript properties - see the Other tab on the Javascript code style.

In the Java code style options there is Wrapping and Braces - Field groups - Align in columns.

However, for js variables you might have to resort to a plugin.

Try DefinitionEqualizer.

Noam answered 15/1, 2012 at 19:5 Comment(0)
C
1

Editor > Code Style > Javascript > 'Other' tab

Formatting options:

  • Align object properties: On colon
  • Align 'var' statements and assignments: Align multiline 'var' statements
Calicut answered 5/9, 2016 at 13:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.