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

support async iterables (for await...of) #1526

Closed
ungoldman opened this issue May 27, 2020 · 5 comments · Fixed by #1519
Closed

support async iterables (for await...of) #1526

ungoldman opened this issue May 27, 2020 · 5 comments · Fixed by #1519

Comments

@ungoldman
Copy link
Contributor

ungoldman commented May 27, 2020

What version of this package are you using?

14.3.4

What problem do you want to solve?

Example code from core fs docs does not pass standard lint:

const fs = require('fs')

async function print (path) {
  const dir = await fs.promises.opendir(path)
  for await (const dirent of dir) {
    console.log(dirent.name)
  }
}
print('./').catch(console.error)
Parsing error: Unexpected token await

https://nodejs.org/api/fs.html#fs_class_fs_dir

What do you think is the correct solution to this problem?

Async iterables (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of) have made it to the spec and are part of the core docs as of at least node v12.12.0.

standard should be able to recognize them and let them pass 🧙

Are you willing to submit a pull request to implement this change?

Maybe

@LinusU
Copy link
Member

LinusU commented May 27, 2020

Is this supported in the latest version of ESLint?

@ungoldman
Copy link
Contributor Author

Seems like it should: eslint/eslint#9957

@LinusU
Copy link
Member

LinusU commented May 27, 2020

Nice, should be fixed by #1518 then!

@ungoldman
Copy link
Contributor Author

ungoldman commented May 27, 2020

thank you! will leave this open until #1518 is resolved

@ungoldman ungoldman linked a pull request May 27, 2020 that will close this issue
8 tasks
@feross
Copy link
Member

feross commented Nov 3, 2020

Fixed in standard 15

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants