The repository's own rules for its Svelte and TypeScript code: the website, the Developer Tools, the playground and the packages.
- Svelte 5 with runes and TypeScript in strict mode. No legacy
$:statements and noexport let; props use$props(). - ESLint, Prettier and
svelte-checkpass with no warnings. - One lint and one set of compiler options for every package and pack: its
eslint.config.jsislintConfig(import.meta.dirname, [its own ignores])from the root'seslint.shared.js, and itstsconfig.jsonextends the root'stsconfig.base.json, adding only itslib,typesandinclude. The guides keep their own, since their examples are written as an author writes them.
- pnpm, installed with its standalone installer. Not through corepack, which Node.js stops shipping from Node 25 on, and not through a Node version manager.
- Every
package.jsonwith a lockfile pins pnpm and Node.js indevEngines, with"onFail": "download", so scripts run on the pinned Node.js, locally and in CI, the wayrust-toolchain.tomlpins Rust. - A bare
nodetyped in a shell may still be another Node.js. Run tools throughpnpm(pnpm exec,pnpm <script>).
- Small components with typed props. One component per file, in
PascalCase.svelte, grouped by area. - Scoped
<style>per component, except in a package that mounts into a page someone else styles: the Developer Tools keep one stylesheet,devtools.css, adopted into the shadow root they mount in, so the page's styles can't reach in and theirs can't leak out. Either way, colors, spacing, radii and type are CSS custom properties. No CSS framework and no inline colors. - Shared state lives in
.svelte.tsmodules with$state, not in global stores.
- Real
<button>,<a>,<input>and<label>elements. No click handlers ondivorspan. - Every icon-only button has an
aria-label. - Keyboard: everything reachable by Tab, and Esc closes overlays.
- Text contrast of at least 4.5:1.
- What a page keeps in
localStorageis a convenience: every read and write is wrapped intry/catch, and the page works without it.
- Vitest, with tests in
foo.test.tsnext tofoo.ts. - Playwright for what runs in a page, by the Playwright rules.