Reputation: 315
I can not for the life of me find a formatter option to turn off automatic line breaks inside no-op function braces. The line breaks are added automatically for both arrow functions and regular functions. This is frustrating when for example passing no op functions to other functions (as a hook or callback), i.e. wrapWithCommonErrors(() => {})
.
function() {}
becomes
function() {
}
() => {}
becomes
() => {
}
Upvotes: 13
Views: 2315
Reputation: 2050
Have you tried the Simple blocks in one line
option?
You can find it at
File
-> Settings
-> Code Style
-> JavaScript
-> Wrapping and Braces
-> Keep when reformatting
Upvotes: 22