Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Inconsistent spacing before function parentheses #1605

Closed
mleanos opened this issue Oct 29, 2016 · 2 comments
Closed

Inconsistent spacing before function parentheses #1605

mleanos opened this issue Oct 29, 2016 · 2 comments

Comments

@mleanos
Copy link
Member

mleanos commented Oct 29, 2016

There are some places in the code-base that have spaces before function parentheses, and some that don't. I'm seeing changes to these in multiple PR's, that go either way (some are creating unnecessary diffs). We should enforce a linting rule in these cases for reasons of consistency.

One example: https://github.com/meanjs/mean/blob/master/modules/users/tests/e2e/users.e2e.tests.js#L411-L424

My personal preference is the same expressed in this comment: airbnb/javascript#55 (comment)

My proposal is to change this eslint setting to

'space-before-function-paren': ['error', {
      'anonymous': 'always',
      'named': 'never',
      'asyncArrow': 'always'
    }]

http://eslint.org/docs/rules/space-before-function-paren#anonymous-always-named-never-asyncarrow-always

When testing this new setting, 242 instances where this rule is violated were reported by the linting task. This would be a big sweeping change, but worthwhile.

Anyone have thoughts on whether we want to implement my proposed change?

@mleanos mleanos self-assigned this Oct 29, 2016
@mleanos mleanos added this to the 0.6.0 milestone Oct 29, 2016
@simison simison mentioned this issue Aug 11, 2017
5 tasks
@simison
Copy link
Member

simison commented Aug 13, 2017

Just tested: eslint --fix handles this really nicely.

@simison
Copy link
Member

simison commented Aug 13, 2017

We just need last two items for 0.6.0 merged (or ignored and refactored later) and we can PR this change + publish 0.6.0. :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants