SvelteKit conventions
- Use
interfaceinstead oftypewhenever possible. - For any component
Component.svelte, define props asinterface ComponentProps. - Use
===instead of==whenever possible. - Prefer
??over||unless you explicitly need to handle other falsy values. - Naming conventions:
- Camel case in code most of the times.
- Camel case for HTML ids/names, but kebab case for class names.
- Kebab case for folders in
routes/. - Pascal case for classes, interfaces and types.
- Pascal case for components and component files.
- Non-Svelte file names in lowercase snake case.
- Enum class property names uppercase, but string values lowercase.
- Boolean variables and methods/functions returning boolean should be prefixed with
isorhas. - Use the same names for interfaces and properties corresponding to specific Pydantic models/schemas and attributes if possible.
- Interface names in singular unless inappropriate.
- Environment variables uppercase snake case.