style: braces always, concat over interpolation

This commit is contained in:
smartass
2026-06-11 23:18:26 +05:00
parent 87b3f118ed
commit d339e5674a
5 changed files with 52 additions and 15 deletions
@@ -9,6 +9,11 @@
**Tech Stack:** `@modelcontextprotocol/sdk` v1 (stable; v2 is npm-alpha only — decided with the user), zod 3, `pg`, `mysql2`, `ssh2`, tsup, Biome, vitest + coverage-v8, testcontainers.
**Conventions for every task:**
- AGENTS.md at repo root is the authority on style. Two rules postdate the code
samples below: ALWAYS braces for if/else/loop bodies, and NO `${}` template
interpolation (use string concatenation; plain multi-line template literals
without `${}`, e.g. SQL, stay). When a sample violates these, rewrite it to
comply while keeping identical behavior.
- Code style: 4 spaces, no semicolons, single quotes, `const fn = () => {}`, no trailing commas before a closing `}`/`]`/`)`. Biome enforces all of this (`semicolons: asNeeded`, `trailingCommas: none`) — run `npx biome check --write src test` before each commit.
- Types must line up without escape hatches: no `as unknown as X`, no `@ts-ignore`/`@ts-expect-error`, no `any` in `src/`. In tests prefer the typed fakes from `test/unit/helpers.ts` (`fakeManager()`); resort to a cast only if there is genuinely no typed way.
- stdout is the MCP protocol channel. Diagnostics go to `console.error` ONLY. Never `console.log`.