# XY Labs - Code Style

> Auto-managed by `yarn xy claude-rules`. Do not edit manually.

- ESM only — no CommonJS (`require`/`module.exports`)
- No semicolons, single quotes, trailing commas, 2-space indent
- `const` over `let`; never `var`
- `function` declarations for top-level; arrows only for callbacks/closures
- Explicit return types on exported functions
- `interface` over `type` for object shapes; named exports over default exports
- Default imports for Node built-ins: `import PATH from 'node:path'` (not named imports)
- No `enum` — use string literal unions or `const` objects
- No `any` — use `unknown`; avoid `as`, prefer type guards
- No `import * as X`; no importing from barrel `index.ts` files
- Prefix unused variables with `_`
- Objects/imports/destructuring with 3+ properties must use multi-line formatting
- When a function uses `await`, return `Promise<T>` — never `Promise<Promisable<T>>`
