Skip to content

Instantly share code, notes, and snippets.

View ithan's full-sized avatar

Ithan lara ithan

  • Prusa3D
  • Prague, czech republic
View GitHub Profile
{"lastUpload":"2021-04-29T10:45:18.447Z","extensionVersion":"v3.4.3"}
const obj = {
  get data() {
    console.log('getter called!');
    return { value: 42 };
  }
};

// With direct object
console.log(obj.data.value);     // logs: "getter called!" then 42

Development Guidelines for Svelte 5 Projects

Core Principles

  • Write modern, safe, and properly typed code with TypeScript
  • Utilize Svelte 5 runes for reactivity
  • Implement stores with native JavaScript getters and setters
  • Follow accessibility best practices
  • Keep components modular (<150-200 lines)
  • snake_case for variable and function names, for files use kebab-case (e.g., user-store.svelte.ts)
  • When using colors in CSS, use vars (e.g., hsl(var(--primary))), all colors use hsl format