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

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.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Feb 8, 2018
@not-an-aardvark
Copy link
Member

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
Copy link
Member Author

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 ESLint is working incorrectly rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Feb 8, 2018
@not-an-aardvark not-an-aardvark merged commit f012b8c into master Feb 10, 2018
@not-an-aardvark not-an-aardvark deleted the async-iteration branch February 10, 2018 03:11
@not-an-aardvark
Copy link
Member

Thanks for contributing!

This was referenced Mar 19, 2018
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Aug 10, 2018
@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 Aug 10, 2018
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 bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🎉 Asynchronous Iteration arrived at Stage 4.
5 participants