From 3e1d7db537ea7e50848ca41185322dc3cd971a75 Mon Sep 17 00:00:00 2001 From: Ajay Ghanwat Date: Wed, 5 Aug 2026 09:59:23 +0530 Subject: [PATCH] fix(rpc): resolve lint warnings from review follow-up - Drop the redundant eslint-disable on AnyProcedures; no-explicit-any is off repo-wide so the directive itself was the warning. Doc comment now explains why none is needed. - Rename test's schema binding to _schema per the lint config's underscore-prefix rule for read-only-as-type bindings. --- packages/rpc/src/types.ts | 3 ++- packages/rpc/test/types.test.ts | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/rpc/src/types.ts b/packages/rpc/src/types.ts index e925438e..56179707 100644 --- a/packages/rpc/src/types.ts +++ b/packages/rpc/src/types.ts @@ -31,8 +31,9 @@ export interface ProcedureDef { * A procedure map with its element types erased. The `any` is deliberate and * confined to this alias: the phantom `__input`/`__output` markers make * ProcedureDef invariant, so no narrower erasure accepts a real contract. + * (No eslint-disable needed — `no-explicit-any` is off repo-wide, and a + * redundant directive is itself a lint warning.) */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any export type AnyProcedures = Record>; export interface ServiceContract { diff --git a/packages/rpc/test/types.test.ts b/packages/rpc/test/types.test.ts index ba6c801b..b6707d06 100644 --- a/packages/rpc/test/types.test.ts +++ b/packages/rpc/test/types.test.ts @@ -4,9 +4,11 @@ import type { InferInput, ProcedureDef, ServiceContract } from "../src/types.ts" describe("rpc types", () => { test("InferInput extracts the validated shape from a schema", () => { - const schema = v.object({ userId: v.string(), amountCents: v.number() }); + // Prefixed with _ : used only via `typeof`, and the lint config requires + // that prefix for a binding that is never read at runtime. + const _schema = v.object({ userId: v.string(), amountCents: v.number() }); // Compile-time assertion: assigning a correctly-shaped value must typecheck. - const value: InferInput = { userId: "u1", amountCents: 10 }; + const value: InferInput = { userId: "u1", amountCents: 10 }; expect(value.userId).toBe("u1"); });