Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

for await loop triggers semi rule #415

Closed
darsain opened this issue Oct 20, 2016 · 7 comments
Closed

for await loop triggers semi rule #415

darsain opened this issue Oct 20, 2016 · 7 comments

Comments

@darsain
Copy link

darsain commented Oct 20, 2016

Can't get this to not throw a Missing semicolon (semi) error on line 2 (for await line):

async function * foo(generator) {
    for await (const value of generator) {
        yield await value;
    }
}

Can't find any info on this. Is it not supported yet? It's a stage-3 candidate proposal, same as async generators, which are parsed properly.

My config:

{
    "env": {
        "es6": true,
        "node": true
    },
    "parser": "babel-eslint",
    "extends": "eslint:recommended",
    "rules": {
        "semi": ["error", "always"]
    }
}
@kaicataldo
Copy link
Member

Can you provide the actual output from ESLint?

@loganfsmyth
Copy link
Member

@taion mentioned this on Slack earlier and linked to https://github.com/eslint/eslint/blob/master/lib/rules/semi.js#L190 as the likely cause since this is represented by a new ForAwaitStatement.

@taion
Copy link

taion commented Oct 21, 2016

See also eslint/eslint#7417. I guess I'll PR it to eslint-plugin-babel if that PR is rejected.

@kaicataldo
Copy link
Member

Ah, got it. Thanks for the info! @taion sounds like a plan.

@darsain
Copy link
Author

darsain commented Oct 24, 2016

@taion so the eslint PR got rejected. Could you please redirect it to eslint-plugin-babel? :)

@cjwatson
Copy link

cjwatson commented Aug 3, 2018

This was added to eslint-plugin-babel a while back; it's in 4.1.2 and newer.

@kaicataldo
Copy link
Member

Fantastic! Thanks for the update.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants