Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

proposal(eslintrc): warn for arrow-parens rule #29

Merged
merged 3 commits into from
Apr 13, 2017

Conversation

Scarysize
Copy link
Contributor

Does anyone remember why we set this to 0? Please discuss.

@yfr yfr requested review from aemkei and mjaros April 11, 2017 07:55
@mjaros
Copy link

mjaros commented Apr 11, 2017

If we set this to 1 without any configuration it should enforce braces, right? Maybe what we want is "as-needed": http://eslint.org/docs/rules/arrow-parens

@Scarysize
Copy link
Contributor Author

That sounds good.

@pwambach
Copy link

"as-needed": 1 👍 so not for a => {} but for (a, b) => {}

@mrMetalWood
Copy link
Collaborator

Plus one for as-needed 👍

@usefulthink
Copy link
Contributor

question, how would eslint know what I want to do here?

function a(arg, cb) {}
function b(...args) {}
function c(arg) {}

a(something, cbArg => callback(cbArg));
b(something, cbArg => callback(cbArg));
c((cbArg1, cbArg2) => cbArg1 + cbArg2);

@aemkei
Copy link
Member

aemkei commented Apr 11, 2017

IMO as-needed is what we want here.

http://eslint.org/docs/rules/arrow-parens#options
http://eslint.org/docs/rules/arrow-parens#as-needed

@usefulthink Guess ESLint is not checking the parameters but only the arguments with this rule.

@yfr yfr merged commit d3c6758 into master Apr 13, 2017
@yfr yfr deleted the proposal/enable-arrow-parens-rule branch April 13, 2017 12:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants