From fbfb6cbc70f87a2efcc337b130b2860307fd9bd2 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Mon, 16 Nov 2026 17:56:11 -0800 Subject: [PATCH] docs(js): don't check at runtime what TypeScript rules out Co-Authored-By: Claude Sonnet 5.5 --- js/AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/js/AGENTS.md b/js/AGENTS.md index dcf2af02c13..34177d35db0 100644 --- a/js/AGENTS.md +++ b/js/AGENTS.md @@ -23,6 +23,7 @@ The `/js` Bun workspace, published as `@moq/`. Run recipes via `just js # Conventions +- Only TypeScript callers are supported, so don't add runtime checks for misuse the types already rule out (extra or wrong-typed arguments, impossible variants). Validate only data that crosses a trust boundary: wire, JSON (zod schemas), and user input such as element attributes. - Only browser performance counts; accept a small regression that shows only on node or bun. - Give each entrypoint a `@module` block. Hide deprecated exports with `@internal` or drop them; never annotate "use X". - `just js check` includes the build, since declaration emit catches errors `--noEmit` misses, and rejects importing a `@moq/*` package the manifest doesn't declare.