Parentheses around single parameter arrow functions / Add support for arrow-parens property
See original GitHub issueHey !
It will be great to add an option to disable auto remove of parenthesis when there is only one argument in an arrow function. Most of professional projects configure their way since it’s the default eslint behaviour. Here is a Eslint Link : http://eslint.org/docs/rules/arrow-parens
// Bad
a => {}
// Good
(a) => {}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:75
- Comments:103 (23 by maintainers)
Top Results From Across the Web
arrow-parens - ESLint - Pluggable JavaScript Linter
Arrow functions can omit parentheses when they have exactly one parameter. In all other cases the parameter(s) must be wrapped in parentheses.
Read more >Expected parentheses around arrow function argument ...
Parentheses around the parameter to an arrow function are optional in ES6 when there's only one argument, but ESLint complains about this by ......
Read more >Use parentheses for an arrow function parameters
To make arrow functions even more concise, some developers prefer to avoid parentheses for an arrow function parameter, if there is only one....
Read more >JS Arrow Functions Parentheses
Hi. Is there an option to remove parentheses if there's only one parameter name in an arrow function when I reformat code? (singleParam)......
Read more >Options - Prettier
"as-needed" - Only add quotes around object properties where required. ... Include parentheses around a sole arrow function parameter. Valid options:.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Prefer Option 5: An
--arrow-parens
flag with optionsalways
,never
, andblock
(or something like that).Prefer Option 2: Adopt airbnb’s behavior (no-parens for implicit-return arrows only)