fix(screener): silence ESLint no-empty / no-undef in canvas helpers

빈 catch 블록 3곳에 의도 주석 추가, test-setup.js 의 beforeEach
명시적 import. 우리 신규 코드의 lint error 0으로 정리.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-13 21:56:42 +09:00
parent 1449342f96
commit 4b64761800
3 changed files with 4 additions and 3 deletions

View File

@@ -31,14 +31,14 @@ export function useCanvasLayout(initialPositions) {
const updateNodePosition = useCallback((nodeId, pos) => { const updateNodePosition = useCallback((nodeId, pos) => {
setPositions((prev) => { setPositions((prev) => {
const next = { ...prev, [nodeId]: { x: pos.x, y: pos.y } }; const next = { ...prev, [nodeId]: { x: pos.x, y: pos.y } };
try { localStorage.setItem(STORAGE_KEY, JSON.stringify(next)); } catch {} try { localStorage.setItem(STORAGE_KEY, JSON.stringify(next)); } catch { /* ignore quota/security errors */ }
return next; return next;
}); });
}, []); }, []);
const reset = useCallback(() => { const reset = useCallback(() => {
setPositions(initialPositions); setPositions(initialPositions);
try { localStorage.removeItem(STORAGE_KEY); } catch {} try { localStorage.removeItem(STORAGE_KEY); } catch { /* ignore security errors */ }
}, [initialPositions]); }, [initialPositions]);
return { positions, updateNodePosition, reset }; return { positions, updateNodePosition, reset };

View File

@@ -18,7 +18,7 @@ export function useScreenerMode() {
const setMode = (m) => { const setMode = (m) => {
if (!VALID_MODES.has(m)) return; if (!VALID_MODES.has(m)) return;
setModeState(m); setModeState(m);
try { localStorage.setItem(STORAGE_KEY, m); } catch {} try { localStorage.setItem(STORAGE_KEY, m); } catch { /* ignore quota/security errors */ }
}; };
return { mode, setMode }; return { mode, setMode };

View File

@@ -1,3 +1,4 @@
import { beforeEach } from 'vitest';
import '@testing-library/jest-dom/vitest'; import '@testing-library/jest-dom/vitest';
// jsdom polyfills for react-flow // jsdom polyfills for react-flow