Space is not being inserted before brace for normal function declarations since 1.5.3
See original GitHub issuefunction foo (){ // <--- no space before left brace
console.log('test')
}
.prettierrc
:
{
"bracesSpacing": true,
"bracketSpacing": false,
"jsxSingleQuote": true,
"semi": false,
"singleQuote": true,
"spaceBeforeFunctionParen": true,
}
Used to work fine in 1.5.2-fix
Also --no-braces-spacing
option does not appear to work. I had to use .prettierrc
.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:8 (1 by maintainers)
Top Results From Across the Web
"insert space between empty braces" not working as expected
The space should be inserted instantly on closing brace, because VS formatter is instant by default for almost all formatting settings. but not...
Read more >Why are spaces required before a curly brace in a function ...
From Bash manual: The braces are reserved words, so they must be separated from the list by blanks or other shell metacharacters. function ......
Read more >Clang-Format Style Options - bcain-llvm
SBPO_ControlStatements (in configuration: ControlStatements ) Put a space before opening parentheses only after control statement keywords ( for/if/while... ).
Read more >Writing R Extensions - The Comprehensive R Archive Network
The sources of an R package consist of a subdirectory containing the files DESCRIPTION and NAMESPACE , and the subdirectories R , data...
Read more >Groovy Language Documentation
Multiline comments can thus be put at the end of a statement, ... the case where the curly braces come immediately after an...
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
That flag doesn’t change the behavior of this bug for me. All function declarations omit the space between the parens and opening brace on the current build.
gets formatted to
Same is true for anonymous functions passed as arguments.
Hi guys, after doing some research, using
--space-empty-fn
solves this issue for me.