Seventeen components declare mutable props, and one antd prop is deprecated #100

Closed
opened 2026-08-21 16:02:14 -05:00 by bermudalamb · 0 comments
Owner

The two mechanical lint categories left in the frontend, kept together because both are find-and-replace rather than judgement.

sonarjs/prefer-read-only-props — 17 sites

The largest remaining warning category by some distance. React props are never written to, and declaring them Readonly<{…}> says so to the compiler rather than to the reader alone. Components fixed in passing already use the shape — ItemCard, ErrorFallback, ErrorBoundary, DevThrow, Customers' cell renderers — so this is finishing a pattern the codebase has already chosen, not introducing one.

Worth doing as one sweep rather than opportunistically. Seventeen warnings is enough to bury the ones that matter, and each fix is a type annotation with no behaviour attached.

sonarjs/deprecation — 1 site

cart/Cart.tsx:234 passes destroyOnClose to an antd component. antd 5.20 deprecates it in favour of destroyOnHidden. Two other places in the codebase already use the newer name, so this one is simply stale.

Deprecated props keep working until they do not, and the failure arrives as an upgrade breaking something unrelated to the change being made. Cheap to close now.

Why one issue

Neither is worth its own, and both are the same kind of work: no design decisions, no behaviour change, verified by the build and the existing suite. Splitting them would create two issues that each say "mechanical, low risk".

Verification

Build clean and lint warnings down by 18 in the frontend. No behaviour change is intended, so the end-to-end suite passing unchanged is the bar. Worth confirming the count actually falls to the expected number rather than assuming — a Readonly<> in the wrong position type-checks and fixes nothing.

Severity

Low. Pure hygiene. Its value is in what it makes visible: with these gone, the frontend's remaining warnings are the eight in #99 that need actual decisions.

Found during a SonarQube and React best-practices review.

The two mechanical lint categories left in the frontend, kept together because both are find-and-replace rather than judgement. ## `sonarjs/prefer-read-only-props` — 17 sites The largest remaining warning category by some distance. React props are never written to, and declaring them `Readonly<{…}>` says so to the compiler rather than to the reader alone. Components fixed in passing already use the shape — `ItemCard`, `ErrorFallback`, `ErrorBoundary`, `DevThrow`, `Customers`' cell renderers — so this is finishing a pattern the codebase has already chosen, not introducing one. Worth doing as one sweep rather than opportunistically. Seventeen warnings is enough to bury the ones that matter, and each fix is a type annotation with no behaviour attached. ## `sonarjs/deprecation` — 1 site `cart/Cart.tsx:234` passes `destroyOnClose` to an antd component. antd 5.20 deprecates it in favour of `destroyOnHidden`. Two other places in the codebase already use the newer name, so this one is simply stale. Deprecated props keep working until they do not, and the failure arrives as an upgrade breaking something unrelated to the change being made. Cheap to close now. ## Why one issue Neither is worth its own, and both are the same kind of work: no design decisions, no behaviour change, verified by the build and the existing suite. Splitting them would create two issues that each say "mechanical, low risk". ## Verification Build clean and lint warnings down by 18 in the frontend. No behaviour change is intended, so the end-to-end suite passing unchanged is the bar. Worth confirming the count actually falls to the expected number rather than assuming — a `Readonly<>` in the wrong position type-checks and fixes nothing. ## Severity Low. Pure hygiene. Its value is in what it makes visible: with these gone, the frontend's remaining warnings are the eight in #99 that need actual decisions. Found during a SonarQube and React best-practices review.
bermudalamb added this to the Code Quality and Hardening 2 project 2026-08-21 16:08:39 -05:00
bermudalamb self-assigned this 2026-08-21 16:09:05 -05:00
bermudalamb moved this to In Progress in Code Quality and Hardening 2 on 2026-08-24 11:35:14 -05:00
bermudalamb moved this to Review in Code Quality and Hardening 2 on 2026-08-24 12:00:49 -05:00
bermudalamb added reference feature/100-readonly-props 2026-08-24 12:01:35 -05:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bermudalamb/redefined-designs#100