machinery
machinery

Reputation: 3945

IntelliJ IDEA: is there a way to automatically format Javascript object literals?

I'm looking for a way to automatically format Javascript object literals in IntelliJ IDEA. I checked Settings > Code style > Javascript but couldn't find anything like this there.

Let me give an example of what I want. I want this:

var a = { prop1: 'abc', prop2: 'def'
         , prop3: 'ghi' };

to be automatically formatted like so:

var a = {
    prop1: 'abc',
    prop2: 'def',
    prop3: 'ghi'
}

I'm using IDEA 12.0.3.

Upvotes: 1

Views: 3579

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 402493

There is a related feature request, star/vote to track the progress.

Upvotes: 3

Related Questions