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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃帀 Asynchronous Iteration arrived at Stage 4. #9891

Comments

@mysticatea
Copy link
Member

@mysticatea mysticatea commented Jan 25, 2018

tc39/proposals@a41dccc

  • Update Espree to support the syntax in ecmaVersion:2018.
    • for await (const x of xs); (ForOfStatement#await)
    • async function* f() {}
    • f = async function* () {}
    • obj = { async* f() {} }
    • class A { async* f() {} }
  • Update core rules to support the syntax.
@not-an-aardvark

This comment has been minimized.

Copy link
Member

@not-an-aardvark not-an-aardvark commented Jan 25, 2018

  • object-shorthand fixer needs to account for async generator methods
  • semi needs to account for for-await-of statements
  • keyword-spacing needs to account for for-await-of statements
  • no-await-in-loop needs to account for for-await-of statements (should not report statements in for-await-of loops)
  • no-useless-computed-key fixer needs to account for async generator methods
  • require-await needs to avoid reporting errors if an async function has a for-await-of loop
@slikts

This comment has been minimized.

Copy link

@slikts slikts commented Jan 30, 2018

I really wish eslint would have a flag similar to V8's --harmony allowing the use of latest language features to avoid situations like this where the actual feature has been usable for almost a year and now is even standardized yet eslint support is lagging.

@mysticatea

This comment has been minimized.

Copy link
Member Author

@mysticatea mysticatea commented Jan 30, 2018

@slikts You can use babel-eslint parser to use experimental syntax.

Now it has arrived at Stage 4, so we have implemented it ASAP: acornjs/acorn#660.
We are awaiting the release of acorn, the upstream of our JavaScript parser.

@mysticatea mysticatea added rule and removed blocked labels Feb 4, 2018
@mysticatea

This comment has been minimized.

Copy link
Member Author

@mysticatea mysticatea commented Feb 5, 2018

I'm working on this.

not-an-aardvark added a commit that referenced this issue Feb 10, 2018
* update keyword-spacing

* update no-await-in-loop

* update object-shorthand

* update require-await

* update tests of generator-star-spacing

* update tests of no-useless-computed-key
@pkhpkh

This comment has been minimized.

Copy link

@pkhpkh pkhpkh commented Feb 19, 2018

So, it looks like this changed the detection site for no-await-in-loop in for-of loops with included await statements, e.g.:

1 | for (x of obj) {
2 |  await foo(x);
3 | }

from the await statement to the loop. (In the example, moved from (2) to (1). This makes sense for for-await-of loops, but seems surprising in a for-of loop.

Is this intentional, or a bug?

This was referenced Mar 22, 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.
You can鈥檛 perform that action at this time.