Skip to content

依存ライブラリ更新の残作業(prettier-plugin-astro v1 / TypeScript 7) #8

Open

Description

@kand417

背景

#3 の依存ライブラリ更新のうち、ほかのパッケージのリリース待ちで止まっている残りの作業です。

作業

prettier-plugin-astro 0.14.1 → 1.x

  • 待っているもの: .astro のクラス並べ替えを v1 に対応させる修正(fix: support prettier-plugin-astro v1 tailwindlabs/prettier-plugin-tailwindcss#473)を含む prettier-plugin-tailwindcss のリリース
    • #473 は 2026-09-29 にマージ済みですが、2026-11-02 時点の最新は 0.8.1(2026-07-15 リリース)で、まだ含まれていません(試験版の insiders 版にしか入っていません)
    • prettier-plugin-astro 1.1.2 と prettier-plugin-tailwindcss 0.8.1 の組み合わせでは、.astro のクラスが並べ替えられないことを確認済み(prettier-plugin-tailwindcssを0.8.1に更新 (#3 Step 2) #7)
  • #473 を含む prettier-plugin-tailwindcss に更新する
  • prettier-plugin-astro を 1.x に更新する
  • .prettierrc.mjs に astroCompressHTML: true を追加する(astro.config.mjs の compressHTML: true に合わせる。v1 の CHANGELOG より)
  • 更新前後で全ファイルの Prettier の出力を比べ、クラスの並べ替えが動くことと、意図しない差分がないことを確認する

TypeScript 5.9 → 6

@astrojs/check 0.9.12 の peer は typescript: ^5.0.0 || ^6.0.0 なので、TypeScript 6 には今すぐ更新できます。

TypeScript 6 → 7

@astrojs/check の TypeScript 7 対応は、来ない見込みです(2026-11-02 時点で @astrojs/check は 0.9.12 のまま)。

  • astro check を TypeScript 7 で実行すると、「TypeScript 7 には対応していないので TypeScript 6 を使ってほしい」というエラーになる(fix(check): explain TypeScript 7 support withastro/astro#18053)

  • そのエラーメッセージによると、astro check は今後のリリースで非推奨になる予定

  • 代わりに、@astrojs/ts-content-mapper(2026-11-02 時点で 0.2.0)を入れて tsc で型チェックする方式が、試験的に用意されている。この方式には TypeScript 7.1 以上が必要

  • 待っているもの: TypeScript 7.1 の正式版(2026-11-02 時点で正式版の最新は 7.0.2、7.1 はベータ版)

  • 参考: astro/check thinks typescript is not installed when using TypeScript 7 withastro/astro#17268

  • TypeScript 7.1 の正式版が出たら、@astrojs/ts-content-mapper を入れ、astro check から tsc での型チェックに切り替える

  • TypeScript を 7 に更新する

  • package.json の build スクリプト(astro check && astro build)と、AGENTS.md の「pnpm run build(astro check を含む)」の記述を、切り替え後の形に合わせる

  • pnpm run build が通り、CI(.github/workflows/ci.yml)も通ることを確認する

確認方法

リリースされたかどうかは、次のコマンドで確認できます。

pnpm outdated
npm view prettier-plugin-tailwindcss version
npm view typescript dist-tags
npm view @astrojs/ts-content-mapper version

Activity

  1. added
    enhancement
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions