Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29377779: Issue 3692 - Add arrow-parens ESLint rule (Closed)

Created:
March 2, 2017, 4:22 a.m. by kzar
Modified:
March 3, 2017, 10:12 a.m.
Visibility:
Public.

Description

Issue 3692 - Add arrow-parens ESLint rule This rule requires that the parenthesis around the arguments for arrow functions are always used, even when not required. So for example `(foo) => foo` is OK, but not `foo => foo`. Notice that this rule doe not care about the braces around the function's body.

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -0 lines) Patch
M eslint-config-eyeo/index.js View 1 chunk +1 line, -0 lines 1 comment Download

Messages

Total messages: 12
kzar
Patch Set 1 This came up in the related adblockplusui review. Apparently Thomas and some ...
March 2, 2017, 4:28 a.m. (2017-03-02 04:28:01 UTC) #1
wspee
On 2017/03/02 04:28:01, kzar wrote: > Patch Set 1 > > This came up in ...
March 2, 2017, 10:01 a.m. (2017-03-02 10:01:19 UTC) #2
Wladimir Palant
https://codereview.adblockplus.org/29377779/diff/29377780/eslint-config-eyeo/index.js File eslint-config-eyeo/index.js (right): https://codereview.adblockplus.org/29377779/diff/29377780/eslint-config-eyeo/index.js#newcode29 eslint-config-eyeo/index.js:29: "arrow-parens": "error", Going through adblockplus and adblockpluscore repositories, the ...
March 2, 2017, 10:03 a.m. (2017-03-02 10:03:29 UTC) #3
kzar
On 2017/03/02 10:03:29, Wladimir Palant wrote: > My preferred solution would be to leave this ...
March 2, 2017, 10:20 a.m. (2017-03-02 10:20:41 UTC) #4
Thomas Greiner
> Maybe Thomas can help me understand how this is going to improve the quality ...
March 2, 2017, 11:15 a.m. (2017-03-02 11:15:57 UTC) #5
Felix Dahlke
On 2017/03/02 10:20:41, kzar wrote: > On 2017/03/02 10:03:29, Wladimir Palant wrote: > > My ...
March 2, 2017, 11:43 a.m. (2017-03-02 11:43:13 UTC) #6
kzar
On 2017/03/02 11:43:13, Felix Dahlke wrote: > My personal preference is the former, but I ...
March 2, 2017, 11:56 a.m. (2017-03-02 11:56:35 UTC) #7
Thomas Greiner
On 2017/03/02 11:43:13, Felix Dahlke wrote: > On 2017/03/02 11:15:57, Thomas Greiner wrote: > > ...
March 2, 2017, 11:56 a.m. (2017-03-02 11:56:57 UTC) #8
Wladimir Palant
On 2017/03/02 11:56:57, Thomas Greiner wrote: > Except that in regards to braces we don't ...
March 2, 2017, 12:33 p.m. (2017-03-02 12:33:30 UTC) #9
Wladimir Palant
And another example where being strict about curly braces caused ridiculous results: https://codereview.adblockplus.org/29375915/diff/29377625/lib/filterListener.js?context=10&column_width=80#newcode211
March 2, 2017, 12:56 p.m. (2017-03-02 12:56:34 UTC) #10
Felix Dahlke
On 2017/03/02 12:56:34, Wladimir Palant wrote: > And another example where being strict about curly ...
March 2, 2017, 3:15 p.m. (2017-03-02 15:15:56 UTC) #11
kzar
March 3, 2017, 10:12 a.m. (2017-03-03 10:12:19 UTC) #12
Message was sent while issue was closed.
OK I've closed this issue since mostly people seem against adding the
arrow-parens rule to our main configuration. Like Thomas points out we can
always add that rule to repositories like adblockplusui where a certain style is
enforced during reviews. That will still avoid time wasting in codereviews
without being too dogmatic elsewhere.

Furthermore it seems from the discussion most people are against how our curly
rule enforced brackets for single line blocks. I've just looked into it and
can't find a way to enforce brackets for multi-line blocks without enforcing
them for single line ones. So I've opened a review to just remove that
controversial rule. https://codereview.adblockplus.org/29377837/

I agree with Felix, no point arguing the edge cases since we already agree on
most rules now.

Powered by Google App Engine
This is Rietveld