Skip to content

prettier-plugin-tailwindcssを0.8.1に更新 (#3 Step 2) - #7

Merged
kand417 merged 1 commit into
mainfrom
chore/3-prettier-plugins
Oct 26, 2026
Merged

kand417 merged 1 commit into
mainfrom
chore/3-prettier-plugins

Conversation

@kand417

@kand417 kand417 commented Oct 26, 2026

Copy link
Copy Markdown
Owner

概要

#3 の Step 2 のうち、Prettier のプラグインの更新です。

Refs #3

変更内容

パッケージ 更新前 更新後
prettier-plugin-tailwindcss 0.6.14 0.8.1
prettier-plugin-astro 0.14.1 0.14.1(据え置き)

prettier-plugin-astro を据え置く理由

prettier-plugin-tailwindcss の CHANGELOG の Unreleased に「Restore class sorting in Astro templates when using prettier-plugin-astro v1(#473)」とあります。実際に試したところ、組み合わせによって次のようになりました。

prettier-plugin-astro prettier-plugin-tailwindcss .astro のクラス並べ替え
0.14.1 0.6.14 ✅
0.14.1 0.8.1 ✅
1.1.2 0.8.1 ❌ 並べ替えられない

#473 を含む prettier-plugin-tailwindcss がリリースされたら、prettier-plugin-astro を v1 に上げます。そのときは、Astro 側の compressHTML: true に合わせて、.prettierrc.mjs に astroCompressHTML: true を指定する必要があります(v1 の CHANGELOG より)。

確認したこと

  • リポジトリ内の44ファイル(.astro / .ts / .mjs / .css / .md)について、更新前後の Prettier の出力を比べた
    • 違いは src/styles/global.css の @plugin '@tailwindcss/typography' → @plugin "@tailwindcss/typography" の1か所だけ(0.7.0 で入った引用符の整形)
    • クラスの並べ替えの結果はすべて同じ
  • pnpm install --frozen-lockfile と pnpm run build が成功する

ファイルの整形はしていません(この PR はツールの更新だけです)。

🤖 Generated with Claude Code

prettier-plugin-astro は 0.14.1 のまま据え置く。
v1 と prettier-plugin-tailwindcss 0.8.1 の組み合わせでは .astro の
クラス並べ替えが動かず、修正(tailwindlabs/prettier-plugin-tailwindcss#473)が未リリースのため。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant