-
Notifications
You must be signed in to change notification settings - Fork 34
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: Plugin does not handle script tags inside expressions correctly #337
Labels
- P3: minor bug
An edge case that only affects very specific usage (priority)
feat: expression
Issue related to formatting of expressions
Comments
Hmm, that one might be a bit challenging. I think it's caused by Prettier's JSX parser not understanding script tags. The issue you posted is unrelated, though. No worries there |
Princesseuh
changed the title
🐛 BUG: Prettier breaks on files containing an object inside a conditional branch
🐛 BUG: Plugin does not handle script tags inside expressions correctly
Jul 18, 2023
1 task
Princesseuh
added
- P3: minor bug
An edge case that only affects very specific usage (priority)
feat: expression
Issue related to formatting of expressions
and removed
needs triage
Issue needs to be triaged
labels
Dec 26, 2023
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
is there a way to add a prettier-ignore comment to silence that error? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
- P3: minor bug
An edge case that only affects very specific usage (priority)
feat: expression
Issue related to formatting of expressions
Describe the Bug
If I have the following file:
when I run
prettier --check --plugin-search-dir=. .
, I get this error:Just for some context, I have that conditional script so I only write it to the tom if an environment variable is present, and inside it I need to create an object.
My guess is that prettier is probably not correctly applying the javascript context inside the script tag when there is this conditional check. It does work as expected if I remove the
{true &&
part, leaving only the script tagSteps to Reproduce
npm init astro
using the default templateLayout.astro
to have the following:prettier --check --plugin-search-dir=. .
to check all files with prettierMight be related to #335
The text was updated successfully, but these errors were encountered: