Bug - Javascript function parens spacing

Even though I have "function declaration parentheses" disabled, my Javascript still gets formatted like this:

something('arg', function () {

when it should be:

something('arg', function() {

Preferences.png

2

It's not a bug. If you like to avoid inserting a white space after 'function' keyword in  callbacks/anonymous functions, please make sure to uncheck 'In function  expression' checkbox in Settings/Editor/Code Style/JavaScript/Spaces,  Before Parentheses. "function declaration parentheses" doesn't affect callbacks formatting.

3

Ahh, I missed that one! Thank you!     

0
Avatar
Permanently deleted user

@Elena that works, thanks. Could we rename the option "In function expression" to something more obvious? Say, "Anonymous function declaration parentheses"?

0

Please feel free to create a request for this in youtrack, https://youtrack.jetbrains.com/issues/WEB

0

 

Hi!

is there a way to format an space after the "function" keyword?

I need this for *.vue

perhaps someone knows about an config-file for this kind of scripts?

thx

 

0

Enabling Settings | Editor | Code Style | JavaScript | Spaces | Before Parentheses | In function expression should do the thing

1

Thx .it works ;-)

0

请先登录再写评论。