You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [8.4](#arrows--one-arg-parens) If your function takes a single argument and doesn’t use braces, omit the parentheses. Otherwise, always include parentheses around arguments for clarity and consistency. Note: it is also acceptable to always use parentheses, in which case use the [“always” option](https://eslint.org/docs/rules/arrow-parens#always) for eslint. eslint: [`arrow-parens`](https://eslint.org/docs/rules/arrow-parens.html)
1022
+
- [8.4](#arrows--one-arg-parens) Always include parentheses around arguments for clarity and consistency. eslint: [`arrow-parens`](https://eslint.org/docs/rules/arrow-parens.html)
1020
1023
1021
-
> Why? Less visual clutter.
1024
+
> Why? Minimizes diff churn when adding or removing arguments.
1022
1025
1023
1026
```javascript
1024
1027
// bad
1025
-
[1, 2, 3].map((x) => x * x);
1026
-
1027
-
// good
1028
1028
[1, 2, 3].map(x=> x * x);
1029
1029
1030
1030
// good
1031
+
[1, 2, 3].map((x) => x * x);
1032
+
1033
+
// bad
1031
1034
[1, 2, 3].map(number=> (
1032
1035
`A long string with the ${number}. It’s so long that we don’t want it to take up space on the .map line!`
1033
1036
));
1034
1037
1038
+
// good
1039
+
[1, 2, 3].map((number) => (
1040
+
`A long string with the ${number}. It’s so long that we don’t want it to take up space on the .map line!`
0 commit comments