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.

Do not add space inside empty curly braces

See original GitHub issue

Summary

❌ When formatting with the VSCode extension : Formatter add space inside empty curl braces, I don’t found how to disable this feature.

✅ When formatting with the CLI : Formatter DO NOT add space inside empty curl braces.

Steps To Reproduce:

This is sample before format.

modal.result.then(
  () => {
    console.log('OK')
  },
  () => {},
)

Expected result

No changes.

Actual result

Formatter add a space inside the empty curly braces

modal.result.then(
  () => {
    console.log('OK')
  },
  () => { },
)

Additional information

VS Code Version: 1.55.2

Prettier Extension Version: v6.3.2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
CharlyPoppinscommented, Jun 1, 2021

Hello, sorry for late response. Actually the problem was a conflict with another formatter, even with this config :

"editor.defaultFormatter": "esbenp.prettier-vscode"

I had to force the formatter for typescript too.

"[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  }
0reactions
github-actions[bot]commented, Sep 9, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript format: disable insert space inside curly braces ...
insertSpace... settings available in VSCode, I have a suggestion to add another one. When I import with curly braces, a space is added...
Read more >
RubyMine does not add spaces inside empty curly braces
I am using a licensed version of RubyMine v5.4.3.2.1 on Mac OS X 10.8.5. Settings->Code Style->Ruby->Other->Spaces around curly braces is inconsistent in ......
Read more >
How to prevent VS from inserting a space after a close curly ...
Doing Mustache in an html page. The first line below is what I need the text to stay as. The second line is...
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 >
c# - What inserts space inside empty curly braces block?
'Something' constantly inserts single space inside the block resulting in { } , which might be pretty annoying for someone. What is causing...
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