Autoformat get/set in typescript

 Hello,

 

when I use autoformat in a typescript-file that contains some getters/setters WebStorm (2017.2.5) handles them like standard methods. So after formating the code there is a blank line between get and set what makes the code very confusing because every class-variable take 6 lines.

Is there a way to remove the blank line between get and set but leave the one between the other methods?

 

As example I wan't the code to be formatted as:

class C {
private _x = 0;
@Input() set x(value) {this._x = value ? value : 0; }
get x() {return this._x;}
}

but it will look like:

class C {
private _x = 0;
@Input()
set x(value) {this._x = value ? value : 0; }

get x() {return this._x;}
}

 

Thanks,

vgkin

0
1 comment

There is no such feature, please vote for https://youtrack.jetbrains.com/issue/WEB-25096 to be notified on any progress with it

0

Please sign in to leave a comment.