Skip to content

Commit b90fe42

Browse files
committed
fix(frontend): resolve lint errors and warnings in multiple components
1 parent 500591e commit b90fe42

4 files changed

Lines changed: 23 additions & 38 deletions

File tree

frontend/src/app/page.tsx

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use client';
22

3+
import Image from 'next/image';
34
import { useRouter } from 'next/navigation';
45
import { useState } from 'react';
56
import type { CSSProperties } from 'react';
@@ -63,7 +64,7 @@ export default function TopPage() {
6364
setShowExplosion(true);
6465

6566
const audio = new Audio('/sounds/start-se.mp3');
66-
audio.play().catch(() => {});
67+
audio.play().catch(() => { });
6768

6869
setTimeout(() => {
6970
router.push('/games/terms');
@@ -88,31 +89,25 @@ export default function TopPage() {
8889
}}
8990
>
9091
<div className="flex flex-col items-center gap-[2vh] w-full">
91-
<img
92+
<Image
9293
src="/images/RealYouLogo.png"
9394
alt="Real You -本当の私じゃだめですか?-"
94-
className="
95-
max-h-[65vh]
96-
w-auto
97-
object-contain
98-
drop-shadow-2xl
99-
"
95+
width={800}
96+
height={500}
97+
className="max-h-[65vh] w-auto object-contain drop-shadow-2xl"
10098
/>
10199

102100
<div className="relative">
103101
<button
104102
onClick={handleStartClick}
105103
className="transition-all duration-100 ease-out hover:scale-110 active:scale-95 active:opacity-50"
106104
>
107-
<img
105+
<Image
108106
src="/images/StartButton.png"
109107
alt="診断スタート"
110-
className="
111-
w-[40vw]
112-
max-w-xs
113-
min-w-[180px]
114-
drop-shadow-md
115-
"
108+
width={320}
109+
height={120}
110+
className="w-[40vw] max-w-xs min-w-[180px] drop-shadow-md"
116111
/>
117112
</button>
118113

frontend/src/features/games/helpdesk/hooks/useHelpdeskGame.ts

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,9 @@ export function useHelpdeskGame(options: {
8080
const isSpeechSupported =
8181
typeof window !== 'undefined' &&
8282
!!(
83-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
84-
(
85-
(window as any).SpeechRecognition ||
86-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
87-
(window as any).webkitSpeechRecognition
88-
)
83+
(window as Window & { SpeechRecognition?: unknown }).SpeechRecognition ||
84+
(window as Window & { webkitSpeechRecognition?: unknown })
85+
.webkitSpeechRecognition
8986
) &&
9087
!!window.speechSynthesis;
9188

@@ -230,12 +227,12 @@ export function useHelpdeskGame(options: {
230227
const hasTextTurn = currentTurns.some((t) => t.inputMethod === 'text');
231228
const textInputMetrics: TextInputMetrics | null = hasTextTurn
232229
? {
233-
typingIntervalVariance:
234-
typingVariancesRef.current.length > 0
235-
? typingVariancesRef.current.reduce((a, b) => a + b, 0) /
236-
typingVariancesRef.current.length
237-
: 0,
238-
}
230+
typingIntervalVariance:
231+
typingVariancesRef.current.length > 0
232+
? typingVariancesRef.current.reduce((a, b) => a + b, 0) /
233+
typingVariancesRef.current.length
234+
: 0,
235+
}
239236
: null;
240237
const game2Data: Game2Data = {
241238
inputMethod: inputMethodRef.current,
@@ -248,7 +245,7 @@ export function useHelpdeskGame(options: {
248245

249246
// 電話終了音
250247
if (hangupAudioRef.current) {
251-
hangupAudioRef.current.play().catch(() => {});
248+
hangupAudioRef.current.play().catch(() => { });
252249
}
253250
}, [onComplete]);
254251

@@ -559,7 +556,7 @@ export function useHelpdeskGame(options: {
559556
const silentAudio = new Audio();
560557
silentAudio.src =
561558
'data:audio/wav;base64,UklGRigAAABXQVZFRm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA=';
562-
silentAudio.play().catch(() => {});
559+
silentAudio.play().catch(() => { });
563560

564561
// マイクの事前許可を求める
565562
try {
@@ -581,7 +578,7 @@ export function useHelpdeskGame(options: {
581578

582579
// 電話呼び出し音を開始
583580
if (callingAudioRef.current) {
584-
callingAudioRef.current.play().catch(() => {});
581+
callingAudioRef.current.play().catch(() => { });
585582
}
586583
}, [gamePhase]);
587584

frontend/src/features/games/terms/components/PopupTerms.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import TermsContent from './TermsContent';
44
import type { FC } from 'react';
55

66
interface PopupTermsProps {
7-
onClose: () => void;
87
onCheckboxChange: (
98
key: 'readConfirm' | 'mailMagazine' | 'thirdPartyShare',
109
checked: boolean
@@ -22,7 +21,6 @@ interface PopupTermsProps {
2221
}
2322

2423
const PopupTerms: FC<PopupTermsProps> = ({
25-
onClose,
2624
onCheckboxChange,
2725
onHiddenInputChange,
2826
checkboxStates,

frontend/src/features/games/terms/components/TermsGameFlow.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { useSetAtom } from 'jotai';
55
import { useRouter } from 'next/navigation';
66
import type { Game1Data, ScrollEvent } from '@/features/games/types';
77
import { game1DataAtom } from '@/stores/games';
8-
import TermsContent from './TermsContent';
98
import PopupAd from './PopupAd';
109
import PopupTerms from './PopupTerms';
1110
// TODO: バックエンド接続時にコメントアウトを解除する
@@ -32,7 +31,7 @@ export default function TermsGameFlow() {
3231
// ポップアップ広告の表示状態
3332
const [showPopup, setShowPopup] = useState(false);
3433
// 利用規約モーダル表示状態(初期で表示)
35-
const [showTermsModal, setShowTermsModal] = useState(true);
34+
const [showTermsModal] = useState(true);
3635
// ゲーム完了フラグ(trueで完了画面を表示→次のゲームへ遷移)
3736
const [isCompleted, setIsCompleted] = useState(false);
3837

@@ -206,10 +205,6 @@ export default function TermsGameFlow() {
206205

207206
{showTermsModal && (
208207
<PopupTerms
209-
onClose={() => {
210-
setShowTermsModal(false);
211-
scrollContainerRef.current = null;
212-
}}
213208
onCheckboxChange={handleCheckboxChange}
214209
onHiddenInputChange={handleHiddenInputChange}
215210
checkboxStates={checkboxStates}

0 commit comments

Comments
 (0)