Single space in empty function body: fuction() {}->function() { }
See original GitHub issueI am wandering if there is a way to configure the following behavior regarding formatting of empty functions (I need a single space in the { } brackets):
Input:
function foo() {
}
Output:
function foo() {}
Expected behavior: function foo() { }
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to write an empty function in Python - pass statement?
In Python, to write empty functions, we use pass statement. pass is a special statement in Python that does nothing. It only works...
Read more >ESLint: disallow empty lines inside function body
I strongly believe that empty lines inside the body of a function are code smells indicating that we need to perform refactoring to...
Read more >Add one space in inline empty function that can be wrapped ...
The documentation for this behaviour can be found here. The purpose of this space is to add this option to clang-format through the...
Read more >Code style - Braces - Keep in one line if body is empty
WEB-53322 Javascript function with no body end braces placement ... Wrapping and Braces that will allow to keep braces in one line if...
Read more >3. Functions — How to Think Like a Computer Scientist
A body consisting of one or more Python statements, each indented the same amount – 4 spaces is the Python standard – from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Then unfortunately Prettier isn’t the tool you’re looking for. It’s an opinionated formatter with few options by design. It reformats your entire file. I’d suggest convincing your team to start using Prettier, like @kachkaev mentions.
Hi! There isn’t! Is there a specific reason you need a space there?