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

prefer-top-level-await: Improve top-level expression detection #1526

Merged
merged 9 commits into from
Dec 30, 2021

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented Sep 17, 2021

Fix #1502

@fisker fisker marked this pull request as draft September 17, 2021 09:20
@sindresorhus
Copy link
Owner

This looks good to me. Is there any reason it is still draft?

@fisker
Copy link
Collaborator Author

fisker commented Oct 12, 2021

await foo.then(bar)

This will still be reported, but I guess we shouldn't.

And

foo.then(bar).then(bar).then(bar).then(bar).then(bar)

Will be many errors, we need to find the promise chain root and only report on the root.


I won't have time to work on this recently.

@fisker
Copy link
Collaborator Author

fisker commented Dec 17, 2021

I didn't forget this, I'll continue to work on it when I got time.

@fisker fisker marked this pull request as ready for review December 29, 2021 03:36
@sindresorhus sindresorhus merged commit b054d65 into sindresorhus:main Dec 30, 2021
@fisker fisker deleted the prefer-top-level-await-improve branch December 30, 2021 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

prefer-top-level-await: Miss cases
2 participants