Back to all reviewers

Consistent code organization

elie222/inbox-zero
Based on 2 comments
Prisma

Maintain consistent patterns when organizing code elements within schema files. Place standard fields (like IDs and timestamps) first in all models to establish a predictable structure. Group similar elements together and position enum definitions at the bottom of schema files.

Code Style Prisma

Reviewer Prompt

Maintain consistent patterns when organizing code elements within schema files. Place standard fields (like IDs and timestamps) first in all models to establish a predictable structure. Group similar elements together and position enum definitions at the bottom of schema files.

Example:

model SomeModel {
  // Standard fields first
  id        String   @id @default(cuid())
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
  
  // Model-specific fields next
  name      String
  status    Status
  
  // Relations last
  relatedItems RelatedItem[]
}

// Enums at the bottom of the file
enum Status {
  ACTIVE
  INACTIVE
}

This organization pattern improves code readability, makes navigation easier across the codebase, and helps team members quickly understand the structure of each schema file.

2
Comments Analyzed
Prisma
Primary Language
Code Style
Category

Source Discussions