Back to all reviewers

Use self-documenting names

block/goose
Based on 2 comments
TSX

Choose variable, function, and constant names that clearly express their purpose and eliminate the need for explanatory comments. Break down complex expressions into well-named intermediate variables rather than relying on comments to explain the logic.

Naming Conventions TSX

Reviewer Prompt

Choose variable, function, and constant names that clearly express their purpose and eliminate the need for explanatory comments. Break down complex expressions into well-named intermediate variables rather than relying on comments to explain the logic.

For example, instead of:

// Use explicit hasEnvVars if provided, otherwise fall back to checking step3Content
const hasConfiguration = hasEnvVars !== undefined ? hasEnvVars : step3Content !== null;

Use descriptive intermediate variables:

const hasConfigurationContent = step3Content !== null;
const shouldShowConfigurationSteps = hasEnvVars ?? hasConfigurationContent;

This principle also applies to extracting repeated string literals into named constants. Instead of using ‘New Chat’ multiple times throughout the code, define a constant like DEFAULT_CHAT_TITLE = 'New Chat' to make the intent clear and improve maintainability.

2
Comments Analyzed
TSX
Primary Language
Naming Conventions
Category

Source Discussions