🐛 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
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: