Skip to content

Reformat .astro files for prettier-plugin-astro v1, plus small link/markup fixes - #542

Merged
sebdanielsson merged 4 commits into
mainfrom
copilot/fix-github-actions-job
Sep 12, 2026
Merged

sebdanielsson merged 4 commits into
mainfrom
copilot/fix-github-actions-job

Conversation

Copilot AI commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

The Cloudflare Pages workflow failed at the format:check step after Renovate bumped prettier-plugin-astro to v1: the new major version changed Astro formatting rules, leaving 18 .astro files non-conformant with prettier . --check.

Formatting changes

  • Ran prettier . --write across the repo — 18 .astro files reformatted, whitespace/line-wrapping only.
  • v1 collapses expression-container braces onto the content's lines instead of wrapping them on their own lines:
-  {
-    tags.map((tag: string) => (
-      <a href={`/blog/tags/${tag}`} ...>{tag}</a>
-    ))
-  }
+  {tags.map((tag: string) => (
+    <a href={`/blog/tags/${tag}`} ...>{tag}</a>
+  ))}
  • Short inline elements now collapse to a single line when they fit:
-<time datetime={date.toISOString()}>
-  {date.toISOString().slice(0, 10)}
-</time>
+<time datetime={date.toISOString()}>{date.toISOString().slice(0, 10)}</time>

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 the target="_blank" links in DockerHubCard.astro, Footer.astro, GitHubRepoCard.astro, guestbook.astro and stats.astro. No rendering change; hardens against reverse-tabnabbing.
  • BlogPost.astro — the <Picture> hero image passed loading twice ("lazy" then "eager"). The duplicate loading="lazy" is removed. This is behaviour-preserving: the Astro compiler emits component props as an object literal, so the duplicate key meant the later loading="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: gisqusgiscus.
  • Footer.astro — the commit link is now href={repoUrl} instead of href={`${repoUrl}/`}. This does change the rendered URL: previously .../commit/<sha>/, now .../commit/<sha>. repoUrl is 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, stylelint and astro check && astro build (77 pages) all pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_016aWLm9W6qAxeJrN66M3f6L

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>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job Reformat .astro files for prettier-plugin-astro v1 to fix format:check CI failure Sep 9, 2026
Copilot AI requested a review from sebdanielsson September 9, 2026 06:41
@sebdanielsson
sebdanielsson marked this pull request as ready for review September 9, 2026 06:42
Copilot AI lite review requested due to automatic review settings September 9, 2026 06:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 .astro files (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.

Comment thread src/components/DockerHubCard.astro Outdated
Comment thread src/components/Footer.astro Outdated
Comment thread src/components/GitHubRepoCard.astro Outdated
Comment thread src/layouts/BlogPost.astro Outdated
Comment thread src/pages/guestbook.astro Outdated
Comment thread src/pages/stats.astro Outdated
@sebdanielsson

Copy link
Copy Markdown
Owner

@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>
Copilot AI review requested due to automatic review settings September 9, 2026 06:53

Copilot AI commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested ch...

Addressed in b56e2ee.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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. Since repoUrl already contains the full commit URL, bind it directly with href={repoUrl}.
    src/pages/guestbook.astro:94
  • The link text gisqus appears to be a misspelling of the service name giscus (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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 only loading="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 (gisqus to giscus) 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

Comment thread src/components/Footer.astro
@sebdanielsson sebdanielsson changed the title Reformat .astro files for prettier-plugin-astro v1 to fix format:check CI failure Reformat .astro files for prettier-plugin-astro v1, plus small link/markup fixes Sep 12, 2026
Base automatically changed from renovate/prettier-plugin-astro-1.x to main September 12, 2026 20:33
@sebdanielsson
sebdanielsson merged commit 88902da into main Sep 12, 2026
6 checks passed
@sebdanielsson
sebdanielsson deleted the copilot/fix-github-actions-job branch September 12, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants