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: examples with arrow functions in no-return-assign (fixes #13135) #13138

Merged
merged 3 commits into from Apr 4, 2020

Conversation

anikethsaha
Copy link
Member

Prerequisites checklist

  • I have read the contributing guidelines.
  • The team has reached consensus on the changes proposed in this pull request. If not, I understand that the evaluation process will begin with this pull request and won't be merged until the team has reached consensus.

What is the purpose of this pull request? (put an "X" next to an 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:

What changes did you make? (Give an overview)

Added incorrect and correct example using arrow function in docs to represent the parenthesis position.

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

fixes #13135

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Apr 3, 2020
@anikethsaha anikethsaha changed the title Updated: docs example for arrow function and tests (fixes #13135) Update: docs example for arrow function and tests (fixes #13135) Apr 3, 2020
@mdjermanovic mdjermanovic 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 and removed triage An ESLint team member will look at this issue soon labels Apr 3, 2020
@mdjermanovic mdjermanovic changed the title Update: docs example for arrow function and tests (fixes #13135) Docs: examples with arrow functions in no-return-assign (fixes #13135) Apr 3, 2020
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Can you please also add an example with a nested assignment in return statement? It could be something like:

function doSomething() {
    return foo = bar && foo > 0;
}

and its correct version:

function doSomething() {
    return (foo = bar) && foo > 0;
}

docs/rules/no-return-assign.md Outdated Show resolved Hide resolved
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Member

@kaicataldo kaicataldo left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! Clearer docs and increased test coverage are always welcome! 🎉

@kaicataldo kaicataldo merged commit 5dfd4eb into eslint:master Apr 4, 2020
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Oct 2, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Oct 2, 2020
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.

Incorrect no-return-assign report
3 participants