Conversation
To fix a bug where an await in a hastag-private-method resulting in the error message "..has both top-level await and export statements"
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #300 +/- ##
=======================================
Coverage 87.23% 87.23%
=======================================
Files 23 23
Lines 7929 7931 +2
Branches 1214 1215 +1
=======================================
+ Hits 6917 6919 +2
Misses 1005 1005
Partials 7 7
🚀 New features to boost your workflow:
|
robertsLando
enabled auto-merge (squash)
September 28, 2026 13:23
robertsLando
approved these changes
Sep 28, 2026
robertsLando
disabled auto-merge
September 28, 2026 13:25
Member
|
Thanks @nytamin for finding and reporting this! Closing as a duplicate of #307, which fixes the same bug by using Babel's |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fix
This PR adds the check
isClassPrivateMethod()to thedetectESMFeaturestopLevelAwaitchecks, to exclude private-hashtag-methods from bein considered top-level.Background
I found a bug where I got the message
path/to/file.js has both top-level await and export statements..., even though I had reduced the file in question to be simply:Adding
parent.isClassPrivateMethod()to the checks fixed the issue for me locally.