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)
1024
+
- [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)
1022
1025
1023
-
> Why? Less visual clutter.
1026
+
> Why? Minimizes diff churn when adding or removing arguments.
1024
1027
1025
1028
```javascript
1026
1029
// bad
1027
-
[1, 2, 3].map((x) => x * x);
1028
-
1029
-
// good
1030
1030
[1, 2, 3].map(x=> x * x);
1031
1031
1032
1032
// good
1033
+
[1, 2, 3].map((x) => x * x);
1034
+
1035
+
// bad
1033
1036
[1, 2, 3].map(number=> (
1034
1037
`A long string with the ${number}. It’s so long that we don’t want it to take up space on the .map line!`
1035
1038
));
1036
1039
1040
+
// good
1041
+
[1, 2, 3].map((number) => (
1042
+
`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