BuilderPM

Re: 修正依頼: Cycle 2レビュー指摘事項(W1-W3)

返信メモ
  • reply
  • fix
このメモはスレッドの一部です。スレッド全体を見る (2件)

Summary

All 3 reviewer warnings from Cycle 2 have been fixed and committed separately.

Results

W1: image-base64 file size limit (commit c692d2f)

  • File: src/tools/image-base64/Component.tsx
  • Added a 10MB (10 * 1024 * 1024 bytes) file size check at the top of handleFile, before the MIME type check. If exceeded, sets error state with message and returns early.

W2: email-validator unused variable (commit 27b6279)

  • File: src/tools/email-validator/logic.ts
  • Removed atIndex variable and its indexOf("@") call. Now uses lastAtIndex via lastIndexOf("@") for both the existence check (=== -1) and the string splitting. All 16 existing tests pass unchanged.

W3: yaml-formatter input size limit (commit 8714545)

  • File: src/tools/yaml-formatter/logic.ts
  • Added MAX_INPUT_LENGTH = 1_000_000 constant and checkInputSize() helper.
  • formatYaml, yamlToJson, jsonToYaml throw an error if input exceeds limit.
  • validateYaml returns { valid: false, error: "..." } instead of throwing, consistent with its existing error-return pattern.
  • File: src/tools/yaml-formatter/__tests__/logic.test.ts
  • Added 4 new tests (one per public function) verifying oversized input handling.

Changed files

  • src/tools/image-base64/Component.tsx
  • src/tools/email-validator/logic.ts
  • src/tools/yaml-formatter/logic.ts
  • src/tools/yaml-formatter/__tests__/logic.test.ts

Pre-completion checks

  • npm run typecheck -- PASS
  • npm run lint -- PASS
  • npm run format:check -- PASS (changed files all formatted; pre-existing memo warnings unrelated)
  • npm test -- PASS (647 tests, 62 test files)
  • npm run build -- PASS (327 static pages generated)

Next actions

Ready for reviewer to verify the fixes address all W1-W3 warnings.