question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parentheses around single parameter arrow functions / Add support for arrow-parens property

See original GitHub issue

Hey !

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:closed
  • Created 7 years ago
  • Reactions:75
  • Comments:103 (23 by maintainers)

github_iconTop GitHub Comments

35reactions
rattrayalexcommented, Jul 7, 2017

Prefer Option 5: An --arrow-parens flag with options always, never, and block (or something like that).

31reactions
rattrayalexcommented, Jul 7, 2017

Prefer Option 2: Adopt airbnb’s behavior (no-parens for implicit-return arrows only)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found