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

Parentheses for arrow function aruments #853

Closed
fanatid opened this issue Apr 11, 2017 · 2 comments

Comments

@fanatid
Copy link

commented Apr 11, 2017

Probably this question was already raised, sorry if this issue is duplicate.

Right now all this expression are valid:

const fn1 = () => {}
const fn2 = (a) => {}
const fn3 = a => {}
const fn4 = (a, b) => {}

When we have exactly one argument, parentheses can be or not be. Will some of this expression standardize in standard? Or two expression will be always valid?

@feross

This comment has been minimized.

Copy link
Member

commented Apr 13, 2017

This is a tough one. We tried enforcing "always use parens around arrow function arguments" but had to revert it since omitting parens is quite a popular style.

This was discussed in #309, #414, and standard/eslint-config-standard#63 if you want to dig into the historical discussion.

@feross feross closed this Apr 13, 2017

@feross

This comment has been minimized.

Copy link
Member

commented Apr 13, 2017

Feel free to continue discussing here, but I'm closing this since I don't expect we'll make any changes anytime soon around this rule.

@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.