# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Longer-form design docs live in [`docs/`](./docs/README.md) — one file per major
decision (the `WithProps` mixin, the prop model, the registration protocol,
event forwarding, per-component special cases, load order, tooling). This file
stays a terse working cheat-sheet; `docs/` is the "why".
## Commands
```bash
npm run build # tsc emits individual ESM modules to dist/ (no bundling)
npm run typecheck # tsc --noEmit, then tsc -p tsconfig.test.json for test/
npm run lint # oxlint over src/ and test/
npm run format # oxfmt formatting
npm run test # vitest run
npm run test:watch # vitest, watch mode
```
Linting runs on `oxlint`, not ESLint/`@typescript-eslint`. This project pins `typescript@^7.0.2`, and `@typescript-eslint` has no released version that supports it (peer range caps at `<6.1.0`, and even loading `@typescript-eslint/parser` crashes against TS 7's package shape). `oxlint` has its own parser and doesn't touch the `typescript` package, so it works regardless of TS version — the tradeoff is no type-aware rules (no `no-floating-promises`, `no-unnecessary-condition`, etc.). Revisit once `@typescript-eslint` supports TS 7.
Formatting runs on `oxfmt` (oxc's Prettier-compatible formatter), configured in `oxfmt.config.ts` (a `defineConfig({...})` default export) — seeded from the old `prettier.config.js` via `oxfmt --migrate=prettier`, so the settings (`semi`, `singleQuote`, `trailingComma: 'all'`, `printWidth: 100`, `tabWidth: 2`) match what Prettier used. The config file sits at the repo root, outside both `tsconfig` `include` globs, so `build`/`typecheck` never compile it. `oxfmt` is pre-1.0; it also formats fenced code blocks inside Markdown, which Prettier left alone.
### Testing
Tests run under Vitest + jsdom (`test/**/*.test.ts`), with a single setup file (`test/setup.ts`) that stubs `ResizeObserver` (jsdom doesn't implement it, and `leaflet-map.ts` constructs one unconditionally) and imports `src/core/globals.ts` so the ambient `HTMLElementTagNameMap` / `HTMLElementEventMap` augmentations are in scope for the whole test program (tests import element modules directly, not the npm entry that would otherwise pull them in). Real Leaflet objects work fine under jsdom for everything this library actually needs to verify (option/attribute wiring, event forwarding); no browser is required. Two things worth knowing:
- Some Leaflet DOM state (the `
`/`