Reformat .astro files for prettier-plugin-astro v1, plus small link/markup fixes - #542
Conversation
Prettier-plugin-astro v1 changed expression-container and inline formatting, breaking format:check. Run prettier --write to conform. Co-authored-by: sebdanielsson <20663065+sebdanielsson@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The diff includes a few concrete issues within changed regions (missing rel="noopener noreferrer" on target="_blank" links, an invalid-looking Astro href=\${...}`usage, and a duplicatedloading` attribute) that should be corrected before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR reformats Astro templates to align with prettier-plugin-astro v1 formatting rules, aiming to restore CI success for format:check without intended behavior changes.
Changes:
- Applied Prettier v1 formatting updates across multiple
.astrofiles (brace placement, wrapping, whitespace normalization). - Normalized JSX-like expression container formatting in Astro templates.
- Adjusted inline element formatting (single-line where possible) per updated Prettier rules.
File summaries
| File | Description |
|---|---|
| src/pages/stats.astro | Prettier-driven whitespace/attribute wrapping updates around Plausible embed markup. |
| src/pages/projects.astro | Reformats .map() render blocks into parenthesized multi-line JSX style. |
| src/pages/index.astro | Collapses/unwraps certain elements per Prettier v1 and normalizes inline spacing. |
| src/pages/guestbook.astro | Reformats “Powered by …” and post rendering loop brace placement. |
| src/pages/about.astro | Reformats repeated .map() render blocks for ItemCard lists. |
| src/layouts/BlogPost.astro | Reformats conditional blocks and fragment rendering for draft/hero image and updated date. |
| src/layouts/BlogList.astro | Reformats list rendering and conditional sections in the blog listing layout. |
| src/components/ThemeSwitcher.astro | Removes extra frontmatter whitespace and collapses empty tags formatting. |
| src/components/Tags.astro | Reformats tag list rendering expression container. |
| src/components/RaycastStoreCard.astro | Reformats categories loop and collapses simple inline paragraph formatting. |
| src/components/MDXInteractive.astro | Reformats variables loop and nested form controls to Prettier v1 style. |
| src/components/ItemCard.astro | Collapses a multi-line div attribute block into a single line per formatter rules. |
| src/components/Header.astro | Reformats navigation link loops and span wrapping to Prettier v1 style. |
| src/components/GitHubRepoCard.astro | Reformats topics loop expression container in the repo card. |
| src/components/FormattedDate.astro | Collapses <time> content to single-line formatting. |
| src/components/Footer.astro | Reformats commit link markup and wraps anchor content across multiple lines. |
| src/components/DockerHubCard.astro | Reformats SVG and “View source on GitHub” inline markup wrapping. |
| src/components/CommonHead.astro | Reformats inline script tag attributes across multiple lines. |
Review details
Suppressed comments (1)
src/pages/guestbook.astro:94
- The link text looks like a typo: "gisqus" should be "giscus".
gisqus
- Files reviewed: 18/18 changed files
- Comments generated: 6
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@copilot Fix the code for all comments in this review thread. When a review comment includes a suggested change, apply the suggestion exactly. Do not make changes beyond what is described in the linked review thread. |
Co-authored-by: sebdanielsson <20663065+sebdanielsson@users.noreply.github.com>
Addressed in b56e2ee. |
There was a problem hiding this comment.
🔵 Needs a closer look
There is at least one confirmed correctness issue introduced in Footer.astro (href={${repoUrl}/} invalid Astro/JSX attribute syntax) that can break parsing/build.
Review details
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
src/components/Footer.astro:17
href={${repoUrl}/}is not a valid Astro/JSX attribute value (template literals must be inside{...}), so this can break parsing/build. SincerepoUrlalready contains the full commit URL, bind it directly withhref={repoUrl}.
src/pages/guestbook.astro:94- The link text
gisqusappears to be a misspelling of the service namegiscus(user-visible).
- Files reviewed: 18/18 changed files
- Comments generated: 0 new
- Review effort level: Lite
- Footer: repoUrl is already the full commit URL, so drop the stray
trailing slash and bind it directly with href={repoUrl}.
- Guestbook: fix user-visible "gisqus" typo in the giscus link text.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016aWLm9W6qAxeJrN66M3f6L
There was a problem hiding this comment.
🟡 Changes recommended
Non-formatting URL, image-loading, text, and security-attribute changes require resolution or explicit confirmation.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (2)
Previously missed (1) — in code that hasn't changed since the last review.
src/layouts/BlogPost.astro:31
- This hunk also removes the earlier
loading="lazy"prop, leaving onlyloading="eager"on the hero image. Because duplicate props made the old behavior ambiguous, please explicitly verify that eager loading is intended and mention this semantic change; the PR description currently says these are whitespace-only edits.
src/pages/guestbook.astro:94
- This hunk also changes rendered content (
gisqustogiscus) and adds a security-related attribute; neither is a Prettier whitespace/line-wrap change as described in the PR. Please either keep these unrelated edits out of this formatting-only PR or update the description and scope accordingly.
<a href="https://giscus.app" target="_blank" rel="noopener noreferrer">
giscus
- Files reviewed: 18/18 changed files
- Comments generated: 1
- Review effort level: Lite
The Cloudflare Pages workflow failed at the
format:checkstep after Renovate bumpedprettier-plugin-astroto v1: the new major version changed Astro formatting rules, leaving 18.astrofiles non-conformant withprettier . --check.Formatting changes
prettier . --writeacross the repo — 18.astrofiles reformatted, whitespace/line-wrapping only.Non-formatting changes
These go beyond whitespace and are listed explicitly — they came out of review feedback on this PR:
rel="noopener noreferrer"added to thetarget="_blank"links inDockerHubCard.astro,Footer.astro,GitHubRepoCard.astro,guestbook.astroandstats.astro. No rendering change; hardens against reverse-tabnabbing.BlogPost.astro— the<Picture>hero image passedloadingtwice ("lazy"then"eager"). The duplicateloading="lazy"is removed. This is behaviour-preserving: the Astro compiler emits component props as an object literal, so the duplicate key meant the laterloading="eager"already won. Eager is also the intended value for an above-the-fold hero image.guestbook.astro— user-visible typo in the link text:gisqus→giscus.Footer.astro— the commit link is nowhref={repoUrl}instead ofhref={`${repoUrl}/`}. This does change the rendered URL: previously.../commit/<sha>/, now.../commit/<sha>.repoUrlis already the complete commit URL, so the trailing slash was unintended; GitHub redirects the slashed form to this canonical one, so the link lands on the same page with one fewer redirect.Verified locally on the final commit:
format:check,lint,stylelintandastro check && astro build(77 pages) all pass.🤖 Generated with Claude Code
https://claude.ai/code/session_016aWLm9W6qAxeJrN66M3f6L