Files
zellyy-finance/clear-storage.html
hansoo 8343b25439 feat: Stage 2 TypeScript 타입 안전성 개선 - any 타입 83개 → 62개 대폭 감소
 주요 개선사항:
- any 타입 83개에서 62개로 21개 수정 (25% 감소)
- 모든 ESLint 에러 11개 → 0개 완전 해결
- 타입 안전성 대폭 향상으로 런타임 오류 가능성 감소

🔧 수정된 파일들:
• PWADebug.tsx - 사용하지 않는 import들에 _ prefix 추가
• categoryUtils.ts - 불필요한 any 캐스트 제거
• TransactionsHeader.tsx - BudgetData 인터페이스 정의
• storageUtils.ts - generic 타입과 unknown 타입 적용
• 각종 error handler들 - Error | {message?: string} 타입 적용
• test 파일들 - 적절한 mock 인터페이스 정의
• 유틸리티 파일들 - any → unknown 또는 적절한 타입으로 교체

🏆 성과:
- 코드 품질 크게 향상 (280 → 80 문제로 71% 감소)
- TypeScript 컴파일러의 타입 체크 효과성 증대
- 개발자 경험 개선 (IDE 자동완성, 타입 추론 등)

🧹 추가 정리:
- ESLint no-console/no-alert 경고 해결
- Prettier 포맷팅 적용으로 코드 스타일 통일

🎯 다음 단계: 남은 62개 any 타입 계속 개선 예정

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 10:08:51 +09:00

136 lines
3.9 KiB
HTML

<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>브라우저 저장소 초기화 - Zellyy Finance</title>
<style>
body {
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
max-width: 600px;
margin: 50px auto;
padding: 20px;
background: #f5f5f5;
}
.container {
background: white;
padding: 30px;
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
button {
background: #007bff;
color: white;
border: none;
padding: 12px 24px;
border-radius: 6px;
cursor: pointer;
margin: 5px;
font-size: 14px;
}
button:hover {
background: #0056b3;
}
.success {
background: #28a745;
}
.success:hover {
background: #218838;
}
.status {
margin: 10px 0;
padding: 10px;
border-radius: 4px;
font-family: monospace;
}
.success-msg {
background: #d4edda;
color: #155724;
}
</style>
</head>
<body>
<div class="container">
<h1>🧹 Zellyy Finance 저장소 초기화</h1>
<p>useAuth 오류 해결을 위한 브라우저 저장소 초기화 도구입니다.</p>
<div id="status"></div>
<h3>1단계: 모든 저장소 초기화</h3>
<button onclick="clearAllStorage()">모든 저장소 및 캐시 초기화</button>
<h3>2단계: 앱으로 이동</h3>
<button class="success" onclick="goToApp()">
Zellyy Finance 앱 열기
</button>
</div>
<script>
function showStatus(message, type = "success-msg") {
const status = document.getElementById("status");
status.innerHTML = `<div class="${type}">${message}</div>`;
}
async function clearAllStorage() {
try {
// 1. 세션 스토리지 초기화
sessionStorage.clear();
// 2. 로컬 스토리지 초기화
localStorage.clear();
// 3. 모든 캐시 삭제
if ("caches" in window) {
const cacheNames = await caches.keys();
await Promise.all(cacheNames.map((name) => caches.delete(name)));
}
// 4. 서비스 워커 삭제
if ("serviceWorker" in navigator) {
const registrations =
await navigator.serviceWorker.getRegistrations();
await Promise.all(registrations.map((reg) => reg.unregister()));
}
// 5. IndexedDB 초기화 (있다면)
if ("indexedDB" in window) {
// Clerk 관련 IndexedDB 데이터 삭제
try {
indexedDB.deleteDatabase("clerk");
} catch (e) {
console.log("Clerk DB 삭제 시도:", e);
}
}
showStatus(
"✅ 모든 저장소가 성공적으로 초기화되었습니다! 이제 앱을 열어보세요."
);
} catch (e) {
showStatus("❌ 저장소 초기화 중 오류: " + e.message, "error");
}
}
function goToApp() {
const timestamp = Date.now();
window.location.href = `http://localhost:3002/?clean=true&t=${timestamp}`;
}
// 페이지 로드 시 현재 상태 표시
window.onload = () => {
const sessionItems = Object.keys(sessionStorage).length;
const localItems = Object.keys(localStorage).length;
if (sessionItems > 0 || localItems > 0) {
showStatus(
`현재 저장된 데이터: SessionStorage ${sessionItems}개, LocalStorage ${localItems}`,
"info"
);
} else {
showStatus("저장소가 이미 깨끗한 상태입니다.");
}
};
</script>
</body>
</html>