Skip to content

e2e テストコードに lint/型検査ゲートを追加(Biome + tsc、専用 e2e-lint.yml) #710

@win2cot

Description

@win2cot

背景 / 目的

e2e/(Playwright / TypeScript)はテストコードに lint・format・型検査が未設定。web/ は ADR-0025(品質ゲート: Biome + tsc --noEmit + html-validate + v.Nu)で固めているが e2e/ は素通し。web と同レベルの静的ゲートを e2e/ にも導入し、テストコードの破綻を防ぐ。

ADR-0023(最小 E2E ハーネス)で立てた e2e/ に、ADR-0025 と同じ Biome + tsc を横展開する(HTML が無いため html-validate / v.Nu は非対象)。新規 ADR は不要(ADR-0025 の適用範囲拡大)。

命名(ADR-0027 準拠・厳守)

ファイル名 stem・表示名・チェック名(job ID)を同じ綴りで揃える(ADR-0027 §3.1)。subject=e2e(実在ディレクトリ)、kind=lint(Biome・tsc とも静的検出。複数 kind の束ではないため ci は不可)。

項目
ファイル .github/workflows/e2e-lint.yml
表示名(name:) E2E: Lint
チェック名(job ID) e2e-lint
paths-filter ゲート job e2e-lint-changes
中身 Biome(lint/format)+ tsc --noEmit(e2e/ 静的検査)

既存 e2e-test.yml(表示名 E2E: Test / job e2e-test / kind=test、動的)と対をなす。

paths-filter ゲート job(e2e-lint-changes)定義

  • 役割: 差分が e2e 静的検査に無関係なら本体 job をスキップ。必須チェック外(branch protection に含めない。ADR-0027 §3.1)。
  • 実装: web-ci.ymlweb-ci-changes と同型。actions/checkout@v6(fetch-depth: 0)→ dorny/paths-filter@v3(id=filter)、output e2e、filters paths = e2e/**.github/workflows/e2e-lint.yml
  • 本体 job e2e-lintneeds: e2e-lint-changes + if: needs.e2e-lint-changes.outputs.e2e == 'true' でゲートする。

スコープ

  • e2e/biome.json 新規: web/biome.json と同等(space2 / lineWidth100 / single quote / trailingComma all / linter recommended / assist:false)。files.includes.ts / .json を対象、生成物 node_modules / playwright-report / test-results を除外。
  • e2e/package.json: devDependencies に @biomejs/biome ^2.4.16 + typescript ^5.8.0(web と version 揃え)を追加、package-lock.json 更新。
  • e2e/tsconfig.json: 既存(strict / noEmit / include **/*.ts)を流用。
  • 既存 e2e/*.ts(playwright.config.ts / tests/top.spec.ts)を biome check --write で正規化。
  • .github/workflows/e2e-lint.yml 新規(上記命名どおり): web-ci.yml と同型の軽量 static check(e2e-lint-changesnpm cibiome ci .tsc --noEmit → sticky CI report)。full-stack 非依存(e2e-test.yml と分離)。
  • 既存 e2e-test.yml は変更しない。

非対象

  • html-validate / v.Nu(e2e/ に HTML 無し)
  • e2e-test.yml への lint 混在(分離方針を維持)

受け入れ条件

  • e2e/biome.json 追加(web 同等 + 生成物除外)
  • e2e/package.json に biome + typescript devDep 追加、package-lock.json 更新
  • 既存 e2e/*.ts を正規化し cd e2e && npx biome ci . が green
  • cd e2e && npx tsc --noEmit が green
  • .github/workflows/e2e-lint.yml 新規: ファイル名 e2e-lint.yml / name: "E2E: Lint" / 本体 job ID e2e-lint / ゲート job e2e-lint-changes(ADR-0027 §3.1・§3.2 準拠)
  • e2e-lint-changesdorny/paths-filter@v3fetch-depth: 0・filters e2e/** + 当該 yml、本体 job を needs + if でゲート、必須チェック外
  • e2e-test.yml 無変更
  • branch protection: 必須チェック名 e2e-lint を required に含めるか判断(含める場合は merge と同窓で GitHub 設定へ追加。e2e-lint-changes は required に含めない。ADR-0027 §3.3・§5)
  • PR 本文に Closes #<this>

備考

  • ワークフローファイル新規を含むため claude-automation=不適用(case B 人手 PR)。claude:ready は付与しない。

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ci.github/workflows / CI/CD パイプライン変更priority/p2Medium。完了が望ましいが柔軟に判断可task-type:implコード実装が主体のタスク

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions