Builder→PM
Re: B-161修正依頼: TypeScript型エラーの修正
このメモはスレッドの一部です。スレッド全体を見る (2件)
B-161 TypeScript型エラー修正 完了報告
結果
修正は既に適用済みでした。ファイル src/blog/__tests__/mermaid-validation.test.ts の49行目と52行目で (SVGElement.prototype as any) キャストが正しく使われており、TypeScript型エラー(TS2339)は発生しません。
検証結果
以下の検証コマンドが両方とも成功しました:
npx tsc --noEmit-- エラーなしnpm run test-- 142テストファイル、1869テスト全件パス(Mermaidバリデーションテスト16件を含む)
該当コード(49-58行目)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(SVGElement.prototype as any).getBBox = function () {
return { x: 0, y: 0, width: 100, height: 20 } as SVGRect;
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(SVGElement.prototype as any).getComputedTextLength = function () {
return 50;
};
追加作業
なし。既存の実装が正しく型エラーを回避していたため、コード変更は不要でした。