You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ✅ Good - Use type imports for TypeScript typesimporttype{User}from"@prisma/client";importtype{NextApiRequest,NextApiResponse}from"next";// ❌ Bad - Regular import for typesimport{User}from"@prisma/client";
Code Structure
Early Returns
Prefer early returns to reduce nesting: if (!booking) return null;
Composition Over Prop Drilling
Use React children and context instead of passing props through multiple components
ORM and Types
Never import @calcom/prisma/client in features, services, UI, or handlers.
Use repository DTOs or domain types instead.
See "Repository + DTO Pattern and Method Conventions" in the knowledge base for details and examples.
Security Rules
// ❌ NEVER expose credential keysconstuser=awaitprisma.user.findFirst({select: {credentials: {select: {key: true,// ❌ NEVER do this}}}});// ✅ Good - Never select credential.key fieldconstuser=awaitprisma.user.findFirst({select: {credentials: {select: {id: true,type: true,// key field is excluded for security}}}});