Back to all reviewers

Consistent clear naming

prisma/prisma
Based on 7 comments
TypeScript

Use consistent terminology across similar concepts and choose names that clearly indicate their purpose. Avoid overloaded terms that cause confusion in your domain context, and ensure naming conventions align with established patterns.

Naming Conventions TypeScript

Reviewer Prompt

Use consistent terminology across similar concepts and choose names that clearly indicate their purpose. Avoid overloaded terms that cause confusion in your domain context, and ensure naming conventions align with established patterns.

Key principles:

  • Consistency across similar concepts: Use the same naming pattern for related functionality (e.g., “Driver Adapters” not “Prisma Adapters”)
  • Avoid overloaded terms: When a term has multiple meanings in your domain, use aliases or more specific names (e.g., alias Schema import as Shape to avoid confusion with domain Schema)
  • Clear purpose indication: Choose names that make functionality obvious and discoverable to users (e.g., ignoreSpanNames instead of ignoreLayersTypes when filtering spans)
  • Domain-appropriate terminology: Use terminology that matches the domain or external standards you’re working with

Example of good naming consistency:

// Good - consistent naming across adapters
export class DriverAdapterError extends Error {
  name = 'DriverAdapterError'
}

// Bad - inconsistent terminology
export class PrismaAdapterError extends Error {
  name = 'PrismaAdapterError'  
}

Example of avoiding overloaded terms:

// Good - avoids confusion with domain Schema
import { Schema as Shape } from 'effect'

// Potentially confusing in Prisma context
import { Schema } from 'effect'
7
Comments Analyzed
TypeScript
Primary Language
Naming Conventions
Category

Source Discussions