We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
<></>
Using the <></> syntax in a conditional causes a SyntaxError but AFAIK this is valid syntax.
SyntaxError
--- --- <!-- snip --> <body> {true ? <span></span> : <></>} </body> </html>
Running npx prettier --check . results in:
npx prettier --check .
Checking formatting... src/pages/index.astro [error] src/pages/index.astro: SyntaxError: Unexpected token (1:24) [error] > 1 | true ? <span /> : < /> [error] | ^
I looked for similar reports, but didn't find anything that matched. Sorry if this is a duplicate.
.prettierrc.yml:
.prettierrc.yml
plugins: - prettier-plugin-astro overrides: - files: "*.astro" options: parser: astro
prettier-plugin-astro
prettier-plugin-astro/node_modules/@astrojs/compiler
npm init astro
npm i --save-dev prettier-plugin-astro prettier
npx prettier --write .
src/pages/index.astro
{true ? <span></span> : <></>}
The text was updated successfully, but these errors were encountered:
Please consider dprint with markup_fmt. It works well with this syntax:
Sorry, something went wrong.
No branches or pull requests
Describe the Bug
Using the
<></>
syntax in a conditional causes aSyntaxError
but AFAIK this is valid syntax.Running
npx prettier --check .
results in:I looked for similar reports, but didn't find anything that matched. Sorry if this is a duplicate.
.prettierrc.yml
:prettier-plugin-astro
: 0.14.0prettier-plugin-astro/node_modules/@astrojs/compiler
: 1.8.2Steps to Reproduce
npm init astro
using template "Empty" and TypeScript strictness "Strictest"npm i --save-dev prettier-plugin-astro prettier
.prettierrc.yml
from the description.npx prettier --write .
npx prettier --check .
reports no errorssrc/pages/index.astro
to include the expression{true ? <span></span> : <></>}
npx prettier --check .
reports a syntax error.The text was updated successfully, but these errors were encountered: