bigblind
bigblind

Reputation: 12867

How to make WebStorm indent es6 object literals correctly?

In es6, you can create an object with a function as one of its members as follows:

var foo = {
    doStuff(a, r, g, s){
        // do some stuff here.
    }
};

But WebStorm (actually PyCharm, but according to JetBrains, PyCharm does everything WebStorm does), doesn't indent what's inside the function, and dedents the closing curly brace. I've entered es6 and various variations into the search field in preferences, but all that comes up are inspections, where I've already enabled es6 features.

Upvotes: 1

Views: 788

Answers (1)

lena
lena

Reputation: 93728

Works fine for me in webStorm 9, 10 EAP and PyCharm 4.0.5 EAP. Please make sure to set JavaScript Language Version to 'ECMAScript 6' in Preferences/Languages&Frameworks/JavaScript

Upvotes: 5

Related Questions