Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebStorm, empty code blocks, and curly braces

Every time I "Reformat Code", WebStorm will place a new-line in between any empty curly braces. For example, if I have this code:

export class Example {}

and I reformat the code (Command + Option + L on mac), I end up with this:

export class Example { }

How can I stop my editor from inserting a new line? WebStorm version is 2016.2

like image 566
exk0730 Avatar asked Nov 23 '16 15:11

exk0730


1 Answers

With these settings it seems to work -- IDE will not break such code into multiple lines but will leave as is.

  1. Settings/Preferences | Editor | Code Style | TypeScript --> Wrapping and Braces
  2. Keep when reformatting | Simple block in one line -- checked
  3. Braces placement | In class declaration -- "End of line"

enter image description here

Screenshot from PhpStorm 2016.3 ... but it should be the same in 2016.2.

like image 175
LazyOne Avatar answered Sep 18 '22 17:09

LazyOne