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

Extra parenthesis added when none expected #1

Closed
vwong opened this issue Oct 13, 2021 · 3 comments · Fixed by #2
Closed

Extra parenthesis added when none expected #1

vwong opened this issue Oct 13, 2021 · 3 comments · Fixed by #2
Labels

Comments

@vwong
Copy link

vwong commented Oct 13, 2021

Version

1.1.0

Details

Extra parentheses added when none expected, causing an invalid syntax.

Expected Behavior

It does not create an invalid syntax.

Actual Behavior

It creates an invalid syntax, and is not idempotent.

Your Environment

Node 16.8.0
Linux

Steps to Reproduce

Write this code. And run prettier.

Ignore the senseless body, it's just to get it long enough, so prettier doesn't make it a single line. The bug happens even with short bodies.

<macro name="recursive">
  <await(generator.next())>
    <@then|{ value, done }|>
      <div>
        <ul><li>${value}</li></ul>
        <ul><li>${value}</li></ul>
        <ul><li>${value}</li></ul>
      </div>
    </@then>
  </await>
</macro>

Notice it gets transformed to (the extra parentheses added).

<macro name="recursive">
  <await(generator.next())>
    <@then|({ value, done })|>
      <div>
        <ul><li>${value}</li></ul>
        <ul><li>${value}</li></ul>
        <ul><li>${value}</li></ul>
      </div>
    </@then>
  </await>
</macro>

Which is invalid code. Indeed, re-running prettier a second time, indicates it as much.

@github-actions
Copy link

🎉 This issue has been resolved in version 1.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@DylanPiercey
Copy link
Contributor

Thanks for taking the time to create the issue @vwong. Let me know if anything else comes up!

@vwong
Copy link
Author

vwong commented Oct 14, 2021

Works great now. Thanks.

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

Successfully merging a pull request may close this issue.

2 participants