build(frontend): close the lint gaps the E32 audit measured
eslint now also enforces: - the React Compiler diagnostics that `recommended` leaves out (todo, memo-dependencies and ten zero-hit tripwires); - a description on every suppression, and no blanket disables; - no focused or skipped tests (vitest and playwright); - the typed pair no-floating-promises and no-deprecated. Lint also covers e2e/ and the TypeScript build configs, which `eslint .` had been skipping in silence. Every hit is fixed or suppressed inline with a named reason: - The 31 try statements the compiler cannot lower yet carry a suppression until S3 rewrites them. Five other compiler skips were plain fixes: a module counter bumped inside a hook, a ref read in a default parameter, and a local named like the <section> it renders. - The real defects behind floating promises are fixed. ChatDock threw at nobody when the device key store could not be opened. VideoEditor's play() rejection went unhandled. loadYouTubeApi never rejected, so a blocked IFrame API left the player on an empty stage forever; it now fails on a script error or after 15 s, shows its own error with the way out, and lets the next open try again. - MutableRefObject, FormEvent and lucide's deprecated brand icon are replaced. The YouTube glyph now lives in lib/brandIcons. - The lint-probe harness lets its virtual file names into TypeScript's default project, so the contract tests still run the real config.
This commit is contained in:
@@ -231,7 +231,7 @@ interface PopoverSurfaceProps {
|
||||
* take its name from. */
|
||||
ariaLabel?: string;
|
||||
focusManaged?: boolean;
|
||||
initialFocus?: number | React.MutableRefObject<HTMLElement | null>;
|
||||
initialFocus?: number | React.RefObject<HTMLElement | null>;
|
||||
/** The surface never receives pointer events — for a passive caption that must not swallow a click
|
||||
* aimed at whatever it happens to cover during its close delay. Interactive hover cards (scrollable
|
||||
* content, links) must NOT set this. */
|
||||
|
||||
@@ -205,7 +205,7 @@ export default function Toaster({
|
||||
{/* lib/toastDock is a one-slot registry: this identity changes only when a surface docks
|
||||
or undocks, and remounting is then the correct behaviour, not the hazard the rule
|
||||
warns about. */}
|
||||
{/* eslint-disable-next-line react-hooks/static-components */}
|
||||
{/* eslint-disable-next-line react-hooks/static-components -- a one-slot dock registry: the identity changes only on dock/undock, where a remount is right */}
|
||||
<Docked />
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -3,9 +3,11 @@ import { useState } from "react";
|
||||
// An overlay's toast-host rank (see the overlay-hosts note in Toaster). Its own module so Toaster exports
|
||||
// only components (Fast Refresh); the counter is module state, so there is exactly one sequence.
|
||||
let overlaySeq = 0;
|
||||
// Outside the hook: the React Compiler cannot lower `++` on a module variable inside one (react-hooks/todo).
|
||||
const nextOverlaySeq = () => ++overlaySeq;
|
||||
/** This overlay's rank among open overlays — taken once, when it mounts. Call it in the overlay
|
||||
* itself, never in a component that can remount while the overlay stays open. */
|
||||
export function useOverlayOrder(): number {
|
||||
const [order] = useState(() => ++overlaySeq);
|
||||
const [order] = useState(nextOverlaySeq);
|
||||
return order;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ export function useSortableA11y(describe: (id: UniqueIdentifier) => SortableSubj
|
||||
// dnd-kit reports the item over ITSELF in the pick-up tick (see above), and this flag is
|
||||
// the only thing separating that from a real move. A ref would be the wrong lifetime —
|
||||
// one drag, not the component.
|
||||
// eslint-disable-next-line react-hooks/immutability
|
||||
// eslint-disable-next-line react-hooks/immutability -- per-DRAG state the announcement closures share; a ref would live as long as the component
|
||||
moved = true;
|
||||
return t("common.dnd.movedOver", landing(active.id, over.id));
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user