question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New option to remove spaces around braces: insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces

See original GitHub issue

From @aymone on July 8, 2016 17:59

  • VSCode Version: 1.3
  • OS Version: Ubuntu 16.04
  • Language: JS

Steps to Reproduce:

1.Create a simple object with functions shorthand like:

const x = {
    a(){}
};

2.Use VSCode auto format (ctrl+shift+i):

const x = {
    a(){ } // why vscode add this extra space between braces?
};

Any way to disable this?

Copied from original issue: Microsoft/vscode#8965

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:5
  • Comments:25 (14 by maintainers)

github_iconTop GitHub Comments

6reactions
takahsercommented, Mar 7, 2018

@chandler0415 this worked for me:

"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false

(you might want to set them to false in your case)

editor: VS Code 1.20.1

5reactions
mhegazycommented, Jul 11, 2016

This should be controled by insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets but looks like it is not being honored.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does vscode support removing spaces after opening and ...
Updated answer for newer vscode version. As of VSCode 1.13, you can disable the automatic space insertion by setting: "javascript.format.
Read more >
space-in-brackets - ESLint - Pluggable JavaScript Linter
This rule aims to maintain consistency around the spacing inside of square brackets, either by disallowing spaces inside of brackets between the brackets...
Read more >
"insert space between empty braces" not working as expected
This option when checked will insert space between empty braces, this works but problem is if you type closing brace while the cursor...
Read more >
Removing spaces placed by \Set command around curly braces
As shown below, the space is \: so you can negate that by redefining the command as \renewcommand\Set[1]{% \csname Set ...
Read more >
Teeth Shifting After Braces - Fredericksburg Orthodontics
No matter which option you choose, it takes time and pressure to shift your teeth into place. Will Teeth Move Back After Braces?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found