Back to all reviewers

Clear consistent naming patterns

getsentry/sentry
Based on 3 comments
TSX

Use clear, consistent naming patterns for variables and event handlers. Avoid abbreviations unless they are widely understood standards. For event handlers, follow the pattern 'on' + 'action' + 'object'.

Naming Conventions TSX

Reviewer Prompt

Use clear, consistent naming patterns for variables and event handlers. Avoid abbreviations unless they are widely understood standards. For event handlers, follow the pattern ‘on’ + ‘action’ + ‘object’.

Good examples:

// Event handler naming
onSortChange: (sort: Sort) => void;     // ✓ Clear and follows pattern
onColumnSortChange: () => void;         // ✗ Redundant, object implied

// Variable naming
const currentSort = useState<Sort>();    // ✓ Clear and explicit
const curSort = useState<Sort>();        // ✗ Unnecessary abbreviation

// Event handler pattern
onChangePassword()                      // ✓ on + action + object
onPasswordChange()                      // ✗ Inconsistent pattern

This promotes code readability and maintains consistency across the codebase. When multiple developers follow the same naming patterns, it becomes easier to understand and maintain the code.

3
Comments Analyzed
TSX
Primary Language
Naming Conventions
Category

Source Discussions