When enabling the ESLint CI job, several pre-existing lint violations were silenced with eslint-disable comments. Three of these are genuine issues worth fixing properly:
1. setState inside useMemo — src/Viewer/Viewer.tsx
setErrMsg is called inside a useMemo callback as error handling for invalid activity source. This is a React anti-pattern that can cause infinite render loops. The error derivation should be restructured — for example, derive the error inline during render (outside useMemo) and use useMemo only for the pure computation.
Rule: react-hooks/set-state-in-render
2. Ref read/write during render — src/activity-viewer.tsx
lastPropSet.current is both read and written during render to track prop changes for variant index generation. Accessing/mutating refs during render is a React anti-pattern. This should be replaced with a useEffect or restructured to avoid the render-time ref mutation entirely.
Rule: react-hooks/refs
3. Untyped spy access in tests — src/test/activityStateReducer.test.ts
spy.mock.lastCall![0].message_id is accessed without typing lastCall[0], requiring file-level disables for no-unsafe-assignment, no-unsafe-member-access, and no-non-null-assertion. Casting to the appropriate message type (e.g., ReportStateMessage) would fix all three.
Rule: @typescript-eslint/no-unsafe-assignment, no-unsafe-member-access, no-non-null-assertion
When enabling the ESLint CI job, several pre-existing lint violations were silenced with
eslint-disablecomments. Three of these are genuine issues worth fixing properly:1.
setStateinsideuseMemo—src/Viewer/Viewer.tsxsetErrMsgis called inside auseMemocallback as error handling for invalid activity source. This is a React anti-pattern that can cause infinite render loops. The error derivation should be restructured — for example, derive the error inline during render (outsideuseMemo) and useuseMemoonly for the pure computation.Rule:
react-hooks/set-state-in-render2. Ref read/write during render —
src/activity-viewer.tsxlastPropSet.currentis both read and written during render to track prop changes for variant index generation. Accessing/mutating refs during render is a React anti-pattern. This should be replaced with auseEffector restructured to avoid the render-time ref mutation entirely.Rule:
react-hooks/refs3. Untyped spy access in tests —
src/test/activityStateReducer.test.tsspy.mock.lastCall![0].message_idis accessed without typinglastCall[0], requiring file-level disables forno-unsafe-assignment,no-unsafe-member-access, andno-non-null-assertion. Casting to the appropriate message type (e.g.,ReportStateMessage) would fix all three.Rule:
@typescript-eslint/no-unsafe-assignment,no-unsafe-member-access,no-non-null-assertion