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

🐛 BUG: Shorthand attr with JSX in conditional expression #224

Closed
ota-meshi opened this issue Jun 24, 2022 · 0 comments · Fixed by #246
Closed

🐛 BUG: Shorthand attr with JSX in conditional expression #224

ota-meshi opened this issue Jun 24, 2022 · 0 comments · Fixed by #246

Comments

@ota-meshi
Copy link
Contributor

ota-meshi commented Jun 24, 2022

Describe the Bug

Using a shorthand attribute with JSX in a conditional expression will result in an error.

---
const content = {};
const enable = true
---

{enable && <MyHeader {content} />}

https://stackblitz.com/edit/github-prettier-plugin-astro-demo-klsxqv?file=src%2Fpages%2Findex.astro

No error will occur if the shorthand is not used.

---
const content = {};
const enable = true
---

{enable && <MyHeader content={content} />}

Steps to Reproduce

I made it possible to check with stackblitz.
In the demo, if there is no error, the formatted code will be displayed.

https://stackblitz.com/edit/github-prettier-plugin-astro-demo-klsxqv?file=src%2Fpages%2Findex.astro

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