Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Clarify arrow function parens in no-extra-parens (fixes #8741) #8822

Merged
merged 1 commit into from Jun 28, 2017

Conversation

platinumazure
Copy link
Member

What is the purpose of this pull request? (put an "X" next to item)

[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

See #8741.

What changes did you make? (Give an overview)

Added note about arrow function parens being covered by arrow-parens instead of no-extra-parens. Also added arrow-parens to Related Rules section.

Is there anything you'd like reviewers to focus on?

Not really.

@platinumazure platinumazure added accepted There is consensus among the team that this change meets the criteria for inclusion documentation Relates to ESLint's documentation rule Relates to ESLint's core rules labels Jun 28, 2017
@eslintbot
Copy link

LGTM

@mention-bot
Copy link

@platinumazure, thanks for your PR! By analyzing the history of the files in this pull request, we identified @pedrottimark, @michaelficarra and @jrvidal to be potential reviewers.

@@ -9,6 +9,8 @@ This rule always ignores extra parentheses around the following:
* RegExp literals such as `(/abc/).test(var)` to avoid conflicts with the [wrap-regex](wrap-regex.md) rule
* immediately-invoked function expressions (also known as IIFEs) such as `var x = (function () {})();` and `((function foo() {return 1;})())` to avoid conflicts with the [wrap-iife](wrap-iife.md) rule

In addition, this rule ignores parentheses around arrow function arguments to avoid conflicts with the [arrow-parens](arrow-parens.md) rule.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be part of the bulleted list right above it, rather than a separate paragraph?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... The only reason I did that was because arrow function arguments are not an expression with malleable precedence, unlike RegExp literals and IIFEs, so it felt like apples/oranges to me. But I don't have a strong preference either way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither do I, so I'm satisfied by your explanation. 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants