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
looks like leading comments wrong when var decls not ends with semi #9102
Comments
Hey @HairyRabbit! We really appreciate you taking the time to report an issue. The collaborators If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack |
I've encountered this as well as it effects nyc ignore hints. From what I can tell the issue occurs to any comment following an object-literal assignment with no trailing semi-colon. I can only reproduce the error if the object-literal has at least one key. obj = {a: 1}
/* istanbul ignore else */
if (true) {} Using Adding the semi-colon after |
Might be fixed by #10445 |
@nicolo-ribaudo I can confirm this fixes the issue both for my example code and for the code posted by @HairyRabbit. |
Bug Report
Bugs maybe
Current Behavior
See the below astexplorer.net screenshots, the second var decl haven't leading comments:
If the first decl ends by semi, it works fine
Input Code
I write a plugin to transform my code, it works with the leading comments
output:
Environment
The text was updated successfully, but these errors were encountered: