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.
This commit is contained in:
2026-08-05 09:59:23 +05:30
parent a4c7d7b298
commit 3e1d7db537
2 changed files with 6 additions and 3 deletions
+4 -2
View File
@@ -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<typeof schema> = { userId: "u1", amountCents: 10 };
const value: InferInput<typeof _schema> = { userId: "u1", amountCents: 10 };
expect(value.userId).toBe("u1");
});