SvelteKit + Svelte 5 + TypeScript + TailwindCSS + Holocene design system
pnpm lint # Run all linters
pnpm check # TypeScript type checking
pnpm test -- --run # Run unit tests// Props
let { class: className = '', adapter }: Props = $props();
// State
let count = $state(0);
// Computed
const doubled = $derived(count * 2);
// Effects
$effect(() => {
console.log('Count:', count);
return () => cleanup();
});
// SuperForms
const { form, errors, enhance } = $derived(
superForm(data, {
SPA: true,
validators: zodClient(schema),
onUpdate: async ({ form }) => {
/* handle submit */
},
}),
);- Node.js built-ins
- External libraries (with
svelte/**first) - SvelteKit imports (
$app/**,$types) - Internal imports (
$lib/**) - Component imports (
$components/**/*.svelte) - Relative imports (
./,../)
- Always run linting: Execute
pnpm lintafter making changes - Type checking: Run
pnpm checkto verify TypeScript compliance - Test execution: Run appropriate test suites based on changes
- Follow patterns: Use existing component patterns and utility functions
- Design system: Prefer Holocene components over custom implementations
- Accessibility: Ensure proper ARIA attributes and semantic HTML
- No comments: Don't add code comments unless explicitly requested
- Type safety: Always provide proper TypeScript types
- Component reuse: Leverage existing components and utilities
- Test coverage: Write tests for new utilities and business logic
- Import organization: Follow the established import order
- Validation: Use Zod for runtime type validation
- Error boundaries: Implement proper error boundaries for components
- Network errors: Handle API failures gracefully
- User feedback: Provide clear error messages and loading states
- Files: kebab-case (
workflow-status.svelte) - Components: PascalCase in imports, kebab-case for files
- Functions: camelCase
- Types: PascalCase
- Use
import typefor type-only imports