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

Fix: support Async iteration (fixes #9891) #9957

Merged
merged 6 commits into from Feb 10, 2018
Merged

Conversation

@mysticatea
Copy link
Member

mysticatea commented Feb 8, 2018

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

[X] Bug fix

Fixes #9891.

What changes did you make? (Give an overview)

This PR fixes false positive and wrongly autofix about async iteration.

  • b80d41a fixed keyword-spacing rule to check the spacing between await and ( in for-await-of loops.
  • 8c0e801 fixed no-await-in-loop rule to not report await expressions on for-await-of loops and to report for-await-of loops as same as await expressions.
  • a64e8fe fixed object-shorthand rule to fix async generators correctly.
  • 1c977b4 fixed require-await rule to handle for-await-of loops as same as await expressions.
  • e30dd5f added tests to generator-star-spacing rule for async generators.
  • 4a2a6a2 added tests to no-useless-computed-key rule for async generators.

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

Are there other rules which need a fix?

I have searched by some node types in rules: ForOfStatement, AwaitExpression, Property, and MethodDefinition.

@not-an-aardvark I'm not sure about semi rule (#9891 (comment)). The semi rule addresses at the end of statements, so it doesn't look to be related to the await keyword in the middle of statements.

mysticatea added 6 commits Feb 7, 2018
@eslint eslint bot added the triage label Feb 8, 2018
@not-an-aardvark

This comment has been minimized.

Copy link
Member

not-an-aardvark commented Feb 8, 2018

The semi rule addresses at the end of statements, so it doesn't look to be related to the await keyword in the middle of statements.

I had that on the list because there were some problems with the semi rule and for-await statements reported in #7417. It might not be an issue now that for-await statements are part of ForOfStatement rather than ForAwaitStatement.

@mysticatea

This comment has been minimized.

Copy link
Member Author

mysticatea commented Feb 8, 2018

I got it. I have missed the issue.
I believe that semi rule is no problem since for-await-of syntax doesn't add the new node type currently.

@not-an-aardvark not-an-aardvark added bug rule accepted and removed triage labels Feb 8, 2018
@not-an-aardvark not-an-aardvark merged commit f012b8c into master Feb 10, 2018
5 checks passed
5 checks passed
commit-message PR title follows commit message guidelines
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
release-monitor No patch release is pending
Details
@not-an-aardvark not-an-aardvark deleted the async-iteration branch Feb 10, 2018
@not-an-aardvark

This comment has been minimized.

Copy link
Member

not-an-aardvark commented Feb 10, 2018

Thanks for contributing!

This was referenced Mar 22, 2018
@renovate renovate bot mentioned this pull request Mar 23, 2018
@eslint eslint bot locked and limited conversation to collaborators Aug 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.