You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Upgrade prettier-plugin-astro to 1.x (blocked on prettier-config) #1629
Area: InfrastructureDeployment, Docker, CI, logging, CLIs, build and test toolingChoreType: maintenance with no user-visible change (dependency upgrades, tooling, tests, refactors)Difficulty: LowIsolated change, about 2 hours or lessPriority: LowNice to have, cosmetic or speculativeUpstreamThe fix belongs in a @douglasneuroinformatics/* package or a third-party dependency
prettier-plugin-astro is held at 0.14.1, its last 0.x release, in the root package.json by the dependency update on the deps branch. The newest release eligible under the repo's 7-day minimumReleaseAge on 2026-10-04 was 1.1.0.
A prettier-config release that peers prettier-plugin-astro ^1. Version 1.1.0 needs Node ≥ 22.12 and Prettier ≥ 3.5.3, and this repo already meets both.
Bump the plugin, run pnpm format, and review how the .astro files in apps/outreach are reformatted.
Still blocked on main (d86740e), but prettier-config is no longer the blocker. package.json:39-53 still pins prettier-config ^0.3.0 and prettier-plugin-astro^0.14.1.
The blocker is now prettier-plugin-tailwindcss
@douglasneuroinformatics/prettier-config@0.4.0 (2026-10-06) peers prettier-plugin-astro: "0.x || 1.x", and #1660 bumps to it in 6b0ad61. That commit keeps the astro plugin on 0.14.1 because of the Tailwind plugin. Plugin 1.x parses with @astrojs/compiler-rs and returns an ESTree/JSX AST. The Astro transform in prettier-plugin-tailwindcss 0.8.1 only matches the element and attribute nodes from 0.x. So it sorts nothing, and it reports no error. tailwindlabs/prettier-plugin-tailwindcss#473 fixes this (merged 2026-09-29), but the fix is still under "Unreleased" in their CHANGELOG. 0.8.1 (2026-07-15) is the latest stable release, and the fix ships only in 0.0.0-insiders.5b27f94.
Results for a probe file, formatted with prettier 3.9.9 and our createConfig options:
astro plugin
tailwind plugin
class="…"
class:list
class={cn(…)}
0.14.1
0.8.1
sorted
sorted
not sorted
1.1.2
0.8.1
not sorted
not sorted
not sorted
1.1.2
insiders.5b27f94
sorted
sorted
sorted
No CI job runs prettier. Only prettier-pre-commit in .husky/pre-commit does, and only on staged files. So if the astro plugin were bumped on its own, sorting would stop and nothing would flag it. Both plugins have to move in the same commit.
The reformat
I ran 1.1.2 with the insiders build over the 34 .astro files on main, all of which are in apps/outreach. All 34 parse and 17 change, and 1.1.1 gives the same output. The new printer is JSX-style:
a single long attribute stays on the tag line, even past 120 columns
>\n</path> collapses to ></path>
{ … } expression blocks lose their brace-only lines
.map((x) => <X />) gains parentheses
Most of the diff is Medical.astro, which goes from 800 lines to 717.
I compiled each changed file before and after with Astro 5's @astrojs/compiler 2.13.1, with compact: true to match compressHTML at astro.config.ts:24. With whitespace ignored, three files compile differently:
Header.astro, because of the added parentheses
Headshot.astro and Feature.astro, because their cn(…) class lists now get sorted
In the emitted HTML, only whitespace changes:
The <h1> in PageHeading.astro and the <p> in Hero.astro and Feature.astro lose the spaces around their expression.
Medical.astro gains spaces between SVG children. It has no <text> element.
Use 1.1.2 or later. It becomes eligible under minimumReleaseAge on 2026-10-30. It depends on @astrojs/compiler-rs ^0.5.2, the same 0.5 line as Astro 7.4.2 (^0.5.1). 1.1.1 is on ^0.4.0.
Wait for two things: build: upgrade dependencies held back by breaking changes #1660 merges, and a stable Tailwind release with the fix is 7 days old. Then bump prettier-plugin-astro to ^1.1.2 and prettier-plugin-tailwindcss together in one build: commit. If that release is 1.0, the 0.x peer in prettier-config 0.4.0 blocks it again, and prettier-config needs another release.
Run pnpm format and commit the result separately as style(outreach). With the insiders build, nothing outside apps/outreach changes: none of the 435 .tsx, .jsx, .css and .html files elsewhere on main move. If the stable release changes any of them, review those changes first.
Verify:
run pnpm --filter @opendatacapture/outreach lint
diff the outreach build output before and after. Expect only the whitespace above and the two reordered class lists.
unsort one class by hand, and confirm the formatter sorts it again
This needs the same exception #1660 got for prettier-config, lint and a format check only. No unit or e2e test can see a formatter change, and outreach has no test suite.
Suggest retitling this to "blocked on prettier-plugin-tailwindcss".
Triage note written with Claude Code. Code references point at main @ d86740e.
Area: InfrastructureDeployment, Docker, CI, logging, CLIs, build and test toolingChoreType: maintenance with no user-visible change (dependency upgrades, tooling, tests, refactors)Difficulty: LowIsolated change, about 2 hours or lessPriority: LowNice to have, cosmetic or speculativeUpstreamThe fix belongs in a @douglasneuroinformatics/* package or a third-party dependency
Activity
joshunrau commentedon Oct 26, 2026
Still blocked on
main(d86740e), but prettier-config is no longer the blocker.package.json:39-53still pins prettier-config^0.3.0andprettier-plugin-astro^0.14.1.The blocker is now prettier-plugin-tailwindcss
@douglasneuroinformatics/prettier-config@0.4.0(2026-10-06) peersprettier-plugin-astro: "0.x || 1.x", and #1660 bumps to it in 6b0ad61. That commit keeps the astro plugin on 0.14.1 because of the Tailwind plugin. Plugin 1.x parses with@astrojs/compiler-rsand returns an ESTree/JSX AST. The Astro transform inprettier-plugin-tailwindcss0.8.1 only matches theelementandattributenodes from 0.x. So it sorts nothing, and it reports no error. tailwindlabs/prettier-plugin-tailwindcss#473 fixes this (merged 2026-09-29), but the fix is still under "Unreleased" in their CHANGELOG. 0.8.1 (2026-07-15) is the latest stable release, and the fix ships only in0.0.0-insiders.5b27f94.Results for a probe file, formatted with prettier 3.9.9 and our
createConfigoptions:class="…"class:listclass={cn(…)}No CI job runs prettier. Only
prettier-pre-commitin.husky/pre-commitdoes, and only on staged files. So if the astro plugin were bumped on its own, sorting would stop and nothing would flag it. Both plugins have to move in the same commit.The reformat
I ran 1.1.2 with the insiders build over the 34
.astrofiles onmain, all of which are inapps/outreach. All 34 parse and 17 change, and 1.1.1 gives the same output. The new printer is JSX-style:>\n</path>collapses to></path>{ … }expression blocks lose their brace-only lines.map((x) => <X />)gains parenthesesMost of the diff is
Medical.astro, which goes from 800 lines to 717.I compiled each changed file before and after with Astro 5's
@astrojs/compiler2.13.1, withcompact: trueto matchcompressHTMLatastro.config.ts:24. With whitespace ignored, three files compile differently:Header.astro, because of the added parenthesesHeadshot.astroandFeature.astro, because theircn(…)class lists now get sortedIn the emitted HTML, only whitespace changes:
<h1>inPageHeading.astroand the<p>inHero.astroandFeature.astrolose the spaces around their expression.Medical.astrogains spaces between SVG children. It has no<text>element.None of this changes how the pages render.
Landing order
minimumReleaseAgeon 2026-10-30. It depends on@astrojs/compiler-rs ^0.5.2, the same 0.5 line as Astro 7.4.2 (^0.5.1). 1.1.1 is on^0.4.0.blog/index.astro, and the reformat rewrites that file.Plan
prettier-plugin-astroto^1.1.2andprettier-plugin-tailwindcsstogether in onebuild:commit. If that release is 1.0, the0.xpeer in prettier-config 0.4.0 blocks it again, and prettier-config needs another release.pnpm formatand commit the result separately asstyle(outreach). With the insiders build, nothing outsideapps/outreachchanges: none of the 435.tsx,.jsx,.cssand.htmlfiles elsewhere onmainmove. If the stable release changes any of them, review those changes first.pnpm --filter @opendatacapture/outreach lintbuildoutput before and after. Expect only the whitespace above and the two reordered class lists.This needs the same exception #1660 got for prettier-config, lint and a format check only. No unit or e2e test can see a formatter change, and outreach has no test suite.
Suggest retitling this to "blocked on prettier-plugin-tailwindcss".
Triage note written with Claude Code. Code references point at
main@d86740e.build: upgrade prettier-config to 0.4.0