From e31c8116b896a75293f0e4213bdd068a5253e0fc Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 24 Aug 2026 10:12:40 +0000 Subject: [PATCH] fix(lint): correctly place two misplaced eslint-disable-next-line directives PR #4849 deleted these two directives because ESLint reported them as unused, but 'unused' here meant misplaced, not stale: each directive's 'next line' landed on a comment/blank line instead of the statement its author meant to cover, so the warning it was meant to suppress was never actually suppressed. - apps/console/.../PublicFormsPage.tsx: the react-hooks/exhaustive-deps directive was an inline block comment inside the useEffect(...) call, so its next line was a blank line. Moved above the statement with the mount-once rationale written out. - packages/react/src/SchemaRenderer.tsx: the no-explicit-any directive's reason wrapped onto a second comment line, so its next line was that continuation comment, not the ForwardedProps declaration. Collapsed to one line. Fixes #4850 --- .changeset/4850-misplaced-eslint-disable.md | 21 +++++++++++++++++++ .../src/pages/developer/PublicFormsPage.tsx | 6 ++++++ packages/react/src/SchemaRenderer.tsx | 1 + 3 files changed, 28 insertions(+) create mode 100644 .changeset/4850-misplaced-eslint-disable.md diff --git a/.changeset/4850-misplaced-eslint-disable.md b/.changeset/4850-misplaced-eslint-disable.md new file mode 100644 index 0000000000..06a3767dab --- /dev/null +++ b/.changeset/4850-misplaced-eslint-disable.md @@ -0,0 +1,21 @@ +--- +--- + +Comment-only fix: two `eslint-disable-next-line` directives were placed on the +wrong line and had never suppressed anything since they landed. + +- `apps/console/src/pages/developer/PublicFormsPage.tsx` — the + `react-hooks/exhaustive-deps` directive was an inline block comment inside the + `useEffect(() => { load(); }, [])` statement, so its "next line" was a blank + line, not the statement itself. Moved above the statement with the reason + written out (mount-once by design; refresh is explicit via the Refresh + button and post-mutation `await load()` calls). +- `packages/react/src/SchemaRenderer.tsx` — the + `@typescript-eslint/no-explicit-any` directive's `--` reason wrapped onto a + second comment line, so its "next line" was that continuation comment, not + `type ForwardedProps = Record;`. Collapsed to one line so the + directive is immediately above its target. + +No logic changes. Verified with `eslint --report-unused-disable-directives`: +both directives are now effective (the two warnings they were meant to +suppress are gone) and neither directive is reported unused. diff --git a/apps/console/src/pages/developer/PublicFormsPage.tsx b/apps/console/src/pages/developer/PublicFormsPage.tsx index 97440deb26..c3d518be41 100644 --- a/apps/console/src/pages/developer/PublicFormsPage.tsx +++ b/apps/console/src/pages/developer/PublicFormsPage.tsx @@ -179,6 +179,12 @@ export function PublicFormsPage() { } }; + // `load` is intentionally omitted from the dependency array: this effect is a + // mount-once fetch. Refresh is driven by the explicit Refresh button + // (`onClick={load}` below) and by explicit `await load()` calls after + // publish/save (see the file-level doc comment), not by re-running on every + // `load` identity change. + // eslint-disable-next-line react-hooks/exhaustive-deps useEffect(() => { load(); }, []); const origin = typeof window !== 'undefined' ? window.location.origin : ''; diff --git a/packages/react/src/SchemaRenderer.tsx b/packages/react/src/SchemaRenderer.tsx index 54b1928b9b..db11eaa51a 100644 --- a/packages/react/src/SchemaRenderer.tsx +++ b/packages/react/src/SchemaRenderer.tsx @@ -411,6 +411,7 @@ export interface SchemaRendererProps { * and `packages/react/README.md` documents callers relying on it. The `any` is * the point: this is a pass-through channel, not a typed prop. */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any -- see doc comment above: the forwarded value is opaque to this component by construction. type ForwardedProps = Record; /**