Skip to content

debt(frontend): lint errors on master: any in EditRiskModal, setState in effects, dead GlobalShortcuts import #864

Description

@alex-dembele

Problem

npx eslint reports errors on master in three files nobody is currently working on. One of them breaks an absolute rule of the project (rule 5, zero any). The others are a dead import and two setState calls made synchronously inside a useEffect, which cost an extra render.

Found during #755 by linting the master versions of the files (git show master:<file> | npx eslint --stdin).

Acceptance criteria

  1. frontend/src/features/risks/components/EditRiskModal.tsx has no any: the risk prop, the asset map callback and the submit handler are typed.
  2. frontend/src/features/risks/RiskWeightsSettings.tsx no longer copies server data into state with setState inside an effect (react-hooks/set-state-in-effect).
  3. frontend/src/App.tsx: the ?guided=1 deep link no longer calls setNewRiskOpen synchronously in an effect, and the unused GlobalShortcuts import is removed. The component it imported was replaced by ShortcutsOverlay + useHotkeys in Implement UX primitives: undoableDelete, ImpactDialog, Hint, ProgressState, PremiumPeek #165, so it is deleted rather than left orphaned.
  4. npx eslint reports zero errors on these three files; tsc -b and the full vitest run stay green.
  5. Behaviour is unchanged and verified live: editing a risk saves, the weights page loads and saves the server's weights, and /risks?guided=1 opens the create-risk dialog once and strips the parameter.

Definition of Done

Criteria 1–5 verified. PR open with Closes #<n>.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions