Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rules inconsistency: function declaration and function invocation, with or without space between function name and `(` #379

Closed
xieranmaya opened this issue Jan 11, 2016 · 2 comments

Comments

@xieranmaya
Copy link

commented Jan 11, 2016

Function declaration:

function fun (arg) { //space between fn name and (
}

Function invocation:

fun(123) //no space between fn name and (

I think it's and inconstancy and the above one do not need SO MUCH spaces and JSbeautifier removes the space between fn name and the (, thus large amount old code do not follow the Standard.

Most popular frameworks/libraries also do not reverse the space between function name and the (, like Angular, Lodash and React:
Angular: https://github.com/angular/angular.js/blob/master/src/ng/controller.js#L26
Lodash: https://github.com/lodash/lodash/blob/master/lodash.js#L381
React: https://github.com/facebook/react/blob/master/src/isomorphic/classic/element/ReactElement.js#L114

Chrome DevTools also format it without spaces:
image

@dcousens dcousens changed the title Rules inconstancy: function declaration and function invocation, with or without space between function name and `(` Rules inconsistency: function declaration and function invocation, with or without space between function name and `(` Jan 11, 2016

@dcousens

This comment has been minimized.

Copy link
Member

commented Jan 11, 2016

@dcousens dcousens closed this Jan 11, 2016

@dcousens dcousens added the i disagree label Jan 11, 2016

@dcousens

This comment has been minimized.

Copy link
Member

commented Jan 11, 2016

And related to #89

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.