docs: CLAUDE.md に typecheck 両 tsconfig 明示と deferred promise pattern の注意を追加 - #393
Merged
Merged
Conversation
…注意を追加 - 開発コマンド節の `pnpm typecheck` に「素の `tsc --noEmit` は分割 tsconfig を発見できず CI と乖離する。push 前検証は script 経由か `-p tsconfig.node.json` + `-p tsconfig.web.json` の両方明示」を追記 - テスト節に「deferred promise pattern は `let x!: T` を使う」を追加。 TS 7 の CFA が Promise executor 内の再代入を後続 narrowing に反映せず `never` 型で TS2349 になる件と、definite assignment assertion で解決 する定石を明文化 session 126 の PR #392 CI で踏んだ 2 件の落とし穴 (HANDOFF §CLAUDE.md 昇格 候補) を恒常事項として昇格。
- 型チェック節: 「CI 相当」削除・`pnpm typecheck:e2e` も CI で走る旨追記 - 型チェック節: 「project を発見できず」→「0 ファイルチェックで exit 0 (沈黙の成功)」に精緻化。solution-style 構成での挙動を明示 - 型チェック節: 直叩き例は `pnpm typecheck` 相当ではなく、先頭で `scripts/generate-katex-css.js` を走らせない点で偽陽性が出る注意を追記 - deferred promise pattern 節: TS 7 帰属を修正 (TS 5.x でも同挙動の 長年仕様であり TS 7 固有ではない)。definite assignment assertion は 「型に伝える」ではなく「未代入チェックを免除する」意味論に修正
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
session 126 の PR #392 CI で踏んだ 2 件の落とし穴 (HANDOFF §「CLAUDE.md / HANDOFF への昇格候補」) を CLAUDE.md に恒久事項として昇格。
関連 Issue
なし (HANDOFF §CLAUDE.md 昇格候補起点)
移行 Stage
(該当なし — agent guidelines のみの変更)
変更内容
pnpm typecheckに、素のtsc --noEmitが solution-style 分割 tsconfig を辿らず「0 ファイルチェックで exit 0 (沈黙の成功)」になる挙動と、直叩き時は-p tsconfig.node.json+-p tsconfig.web.jsonの両方明示、pnpm typecheckscript がscripts/generate-katex-css.jsを先に走らせる点、CI でpnpm typecheck:e2eも走る点を明記。pnpm typecheck:e2eの実行行も併記let x!: Tを使う」を追加。TypeScript の CFA (TS 5.x / TS 7 いずれも同挙動、TS 7 固有ではない) が nested function 内の再代入を後続 narrowing に反映せずnever型で TS2349 になる件と、definite assignment assertion で「未代入チェックを免除する」ことで解決する定石を明文化動作確認
tsconfig.node.json/tsconfig.web.json/tsconfig.e2e.jsonの実在確認package.json:scripts.typecheckが両 tsconfig を叩く実装であることを確認./node_modules/.bin/tsc --noEmitが「exit 0 / 0 ファイル」の沈黙成功になることを実測resolveDeferred?.()パターンが TS 7.0.2 / TS 5.9.3 いずれもTS2349を返し、let x!: () => voidパターンで解決することを実測.github/workflows/ci.yml:45-47でpnpm typecheckとpnpm typecheck:e2eの両方が走ることを確認スクリーンショット
なし (docs-only)
検証エビデンス
リスク分類
tier: high — agent-config: CLAUDE.md (agent の動作規範を書き換える変更)
実行した検証
3d73b10)、Suggestion 2 件を (c) 対応しないレビュー指摘と対応
codex-review は session 122-126 で 5 セッション連続 401 恒常化のため、最初から Fable general-purpose 代替に直行 (session 126 と同じ運用)。
pnpm typecheck:e2eも CI で走るが未言及)3d73b10)3d73b10)pnpm typecheckと等価でない (node scripts/generate-katex-css.js欠落)3d73b10)3d73b10)3d73b10)追跡先
Draft 判定