Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code - Code Formatting space before curly braces

Tags:

When I use autoformat function in VS Code editor it insert spaces before curly brackets like this:

From:

<Button onClick={this.callMyFunc.bind(this, screenSet.index)}>Add</Button> 

To:

<Button onClick={this.callMyFunc.bind(this, screenSet.index) }>Add</Button> 

From:

))} 

To:

)) } 

I can't find option what settings this... Can anyone help me, please?

like image 834
David Slavík Avatar asked Jun 10 '16 09:06

David Slavík


People also ask

How do I arrange the format code in Visual Studio?

The code formatting is available in Visual Studio Code through the following shortcuts: On Windows Shift + Alt + F. On Mac Shift + Option + F. On Linux Ctrl + Shift + I.


Video Answer


1 Answers

In 2020, the properties are called this way:

"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false "typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false 
like image 54
human Avatar answered Sep 28 '22 08:09

human