Back to all reviewers

Consistent variable style patterns

vercel/next.js
Based on 3 comments
TypeScript

Maintain consistent patterns for variable declarations and naming conventions: use const by default for variable declarations, use clear complete words in variable names instead of abbreviations, and for truthiness checks prefer simple boolean conditions unless explicit null/undefined checks are required.

Code Style TypeScript

Reviewer Prompt

Maintain consistent patterns for variable declarations and naming conventions:

  1. Use const by default for variable declarations, only use let when the variable needs to be reassigned
  2. Use clear, complete words in variable names instead of abbreviations
  3. For truthiness checks, prefer simple boolean conditions unless explicit null/undefined checks are required

Example:

// โŒ Inconsistent patterns
let lockFile = findRootLockFile(cwd)
const normChunkPath = '/path'
if (testWasmDir != null) {
  // ...
}

// โœ… Consistent patterns
const lockFile = findRootLockFile(cwd)
const normalizedChunkPath = '/path'
if (testWasmDir) {
  // ...
}

This promotes code readability and reduces cognitive load by establishing predictable patterns across the codebase.

3
Comments Analyzed
TypeScript
Primary Language
Code Style
Category

Source Discussions