最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Option to not add line breaks in no-op (empty) functions in JavaScript (IntelliJ WebPHP storm) - Stack Overflow

programmeradmin9浏览0评论

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
() => { }

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
() => { }

Share Improve this question asked Apr 19, 2016 at 21:46 TapppiTapppi 3152 silver badges11 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 22

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

发布评论

评论列表(0)

  1. 暂无评论