GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: biome 2.5.5 の noUnsafeOptionalChaining 強化に test 5 箇所を追従して bump を再投入 by ymnao · Pull Request #437 · ymnao/scripta

Conversation

@ymnao

@ymnao ymnao commented Jul 27, 2026

Copy link
Copy Markdown
Owner

概要

session 139 の Dependabot 統合 PR (#436) で CI lint を落とした biome 2.5.2 → 2.5.5 の bump を、原因だった既存 test 5 箇所の修正込みで再投入する。

原因は biome 2.5.5 の lint/correctness/noUnsafeOptionalChaining 強化で、(x?.y as T)() 形(optional chaining の結果を cast して呼ぶ)が新規に error 判定になったこと。#436 では該当 commit を revert して green 化し、biome は 2.5.2 に据え置かれていた。

関連 Issue

なし(HANDOFF の ⚑「biome 2.5.5 対応」を消化。#377 は Dependabot の bump PR だが本 PR が bump 自体を含むため reopen 不要)

移行 Stage

該当なし(移行 Stage 外のツールチェイン保守)

変更内容

  • @biomejs/biome を 2.5.2 → 2.5.5 に bump(biome.json の $schema も 2.5.5 へ追従)
  • 2.5.5 で lint error になる 5 箇所を、vitest の assert() で narrow してから cast する形に変更
    • electron/main/menu.test.ts の 4 箇所(File > New Window / File > エクスポート... / Help > Keyboard Shortcuts / App > Settings...)
    • src/components/editor/live-preview/math.test.ts の 1 箇所(inline math widget の tex 検証)
  • non-null assertion (!) は不採用。repo 内の使用実績がゼロで、style/noNonNullAssertion にも該当するため。assert() は runtime check を伴い TypeScript の narrowing も効く(chai の asserts expression signature)ので、置換前の expect(x).toBeDefined() と同じ pin を保てる
  • assert() には失敗理由メッセージを第 2 引数で付与(findItem が空振りしたときに "expected undefined to be truthy" だけにならないようにする)

動作確認

  • 対象 2 ファイルの unit test(55 passed / 2 skipped)
  • full unit suite(132 files / 2864 passed / 2 skipped)
  • typecheck 3 tsconfig(node / web / e2e すべて exit 0)
  • mutation 検証 1 本(findItem を存在しないラベルで空振りさせると assert 行で fail することを実測)
  • production build(electron-vite build 成功)
  • biome 2.5.5 実バイナリでの lint — ローカル実行不能(下記エビデンス参照)。CI の lint job が初検証になる

スクリーンショット

なし(UI 変更なし)

検証エビデンス

リスク分類

tier: high — dependency: package.json pnpm-lock.yaml

実行した検証

種別 コマンド 結果
テスト(対象ファイル) ./node_modules/.bin/vitest run electron/main/menu.test.ts src/components/editor/live-preview/math.test.ts PASS 55 passed / 2 skipped
テスト(full suite) ./node_modules/.bin/vitest run PASS 132 files / 2864 passed / 2 skipped
テスト(mutation) findItem(tpl, "File", "No Such Item") へ置換して vitest 実行 期待どおり FAIL(menu.test.ts:88 の assert(item) で停止)→ 復元済み
型チェック tsc --noEmit -p tsconfig.node.json / tsconfig.web.json / tsconfig.e2e.json 3 本とも exit 0
Lint ./node_modules/.bin/biome check .(installed 版 = 2.5.2) exit 0(info 1 件は $schema 2.5.5 と binary 2.5.2 の版差の migrate 案内。CI では 2.5.5 が入るため消える)
Lint(2.5.5 実バイナリ) — 未実施。sandbox は pnpm global store が書き込み不可のため --lockfile-only で lockfile のみ更新しており、node_modules は 2.5.2 のまま。curl も sandbox で不可なため 2.5.5 バイナリを持ち込めない。CI の lint job に委ねる
ビルド node scripts/generate-katex-css.js + ./node_modules/.bin/electron-vite build PASS(INEFFECTIVE_DYNAMIC_IMPORT 警告は既存)
レビュー /simplify(4 観点を 1 pass に統合、sonnet) 0 findings
レビュー code-reviewer round 1(fable) Critical 0 / Warning 0 / Suggestion 1 → 1 件 fix(commit 4cfd8ba)
レビュー code-reviewer round 2(fable) Critical 0 / Warning 0 / Suggestion 2(いずれもコード修正を伴わない)
レビュー codex-review security pass / 0 findings
レビュー codex-review shell-senior pass / 0 findings
レビュー codex-review qa-fixture pass / 0 findings
CI — PR 作成時に初回実行。この repo の CI は push: branches: [main] + pull_request トリガーのため、feature branch への push だけでは run が作られない

レビュー指摘と対応

# Finding 対応
1 code-reviewer round 1: assert() に第 2 引数のメッセージを付けると失敗理由が自明になる (a) fix — 5 箇所すべてに付与(commit 4cfd8ba)
2 code-reviewer round 2: node_modules は 2.5.2 のままなので 2.5.5 実バイナリでの lint は未検証。merge 前に CI lint job の green 確認が必要 指摘のとおり。上記エビデンス表に明記し、merge ゲートを CI に置く(コード修正は不要)

codex-review は 3 観点とも finding ゼロのため転記表なし。

追跡先

backlog delta: 起票 0 件 / 本 PR で close 0 件 / 現在 open 17 件

本 PR で fix しない finding: なし

Draft 判定

  • 判定: normal
  • 根拠: step 4 — (a) fix 対象の未対応なし、(b) 起票対象なし、(c) 対応しない対象なし。codex-review 3 観点すべて pass

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ymnao and others added 2 commits July 28, 2026 00:40
@ymnao @claude
fix: biome 2.5.5 の noUnsafeOptionalChaining 強化に test 5 箇所を追従
c540f45
- @biomejs/biome を 2.5.2 → 2.5.5 に bump (biome.json の $schema も追従)
- 2.5.5 で lint error になる `(x?.y as T)()` 形の 5 箇所を、vitest の
  assert() で narrow してから cast する形に変更
  - electron/main/menu.test.ts:90/99/110/120
  - src/components/editor/live-preview/math.test.ts:334
- non-null assertion (`!`) は repo 内使用ゼロ + style/noNonNullAssertion
  に該当するため不採用。assert() は runtime check を伴い TS narrowing も
  効くので、既存の expect(x).toBeDefined() と同じ pin を保てる
- 検証: mutation 1 本 (findItem を空振りさせると assert 行で fail) を実測

sandbox では pnpm store が書き込み不可のため lockfile のみ更新しており、
biome 2.5.5 実バイナリでの lint 検証は CI に委ねる。

Co-Authored-By: Claude Opus 5 <[email protected]>
@ymnao @claude
test: assert() に失敗理由メッセージを付与 (code-reviewer Suggestion)
4cfd8ba
- findItem / widget 検索が空振りしたときの失敗メッセージが
  "expected undefined to be truthy" だけにならないよう、5 箇所の
  assert() に第 2 引数の説明を追加
- 置換前の expect(x).toBeDefined() にも custom message は無かったため
  劣化の修復ではなく診断可能性の純増

Co-Authored-By: Claude Opus 5 <[email protected]>
@ymnao

ymnao commented Jul 27, 2026

Copy link
Copy Markdown
Owner Author

CI 全 10 check pass。PR body の検証エビデンスで「未実施 → CI に委ねる」としていた biome 2.5.5 実バイナリでの lint も green になり、唯一の未検証項目が解消した。

job 結果
lint (biome 2.5.5) pass 47s
typecheck pass 29s
test pass 1m37s
e2e pass 3m5s
electron-e2e pass 57s
build pass 31s
verify pass 2m50s
dependency-review pass 7s
CodeQL / Analyze (javascript-typescript) pass 3s / 1m2s
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ymnao
ymnao merged commit 92e7d0d into main Jul 27, 2026
10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ymnao
ymnao deleted the fix/biome-255-unsafe-optional-chaining branch July 27, 2026 17:05
@ymnao ymnao mentioned this pull request Sep 26, 2026
chore(deps): open な Dependabot PR 10 件を 1 branch に統合する #562
Merged
5 of 6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@ymnao
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.