- Build:
bun run buildorvite build - Lint:
npm run lint(prettier + eslint) - Note: May fail on AI-generated files inai-generated/folder - Typecheck:
bun check(preferred overnpx tsc) - Run this instead of lint for code validation - Test Suite:
npm run test(unit + e2e) - Unit Tests:
npm run test:unitorvitest run - Single Unit Test:
vitest run <test-file> - E2E Tests:
npm run test:e2eorplaywright test - Single E2E Test:
playwright test <test-file> - Watch Tests:
npm run test:watchorvitest
- Use tabs (not spaces)
- Single quotes
- No trailing commas
- Print width: 100 characters
- Plugins: prettier-plugin-svelte, prettier-plugin-tailwindcss
- TypeScript ESLint + Svelte plugin
- Prettier integration
- Ignores: build/, .svelte-kit/, dist/
- Strict mode enabled
- ESNext modules with bundler resolution
- Path aliases:
$lib→/src/lib,@→/src
- State:
let count = $state(0)(not legacy$:) - Props:
let { title } = $props() - Derived:
let doubled = $derived(count * 2) - Effects:
$effect()only for side effects (logging, DOM, external APIs) - Events:
onclick={handler}(noton:click)
- Components: PascalCase
- Files: kebab-case
- Functions/variables: camelCase
- Types: PascalCase
- Pages:
src/routes/ - Components:
src/lib/components/ - Utilities:
src/lib/utility/ - Server code:
src/lib/server/ - Types:
src/types/
- Use path aliases (
$lib/,@/) - Prefer async/await over promises
- Use try/catch for error handling
- Export types from
.sveltefiles for TypeScript
- DB Studio:
npm run db:studio - DB Push:
npm run db:push - DB Migrate:
npm run db:migrate - Dev Server:
bun run dev(port 5178) - Preview:
vite preview
Follow all Svelte 5 rules from .github/copilot-instructions.md:
- Modern reactive syntax only
- Prefer
$derived()over$effect()for computations - Use callback props over event dispatchers
- Place AI-generated docs in
ai-generated/folder