Back to all reviewers

Use consistent curly braces

nestjs/nest
Based on 5 comments
TypeScript

Always use curly braces for conditional statements and loops, even for single-line bodies. This maintains consistency throughout the codebase and improves readability. Avoid inline conditionals.

Code Style TypeScript

Reviewer Prompt

Always use curly braces for conditional statements and loops, even for single-line bodies. This maintains consistency throughout the codebase and improves readability. Avoid inline conditionals.

Instead of:

if (areThereNoFileIn && this.fileIsRequired) return;
if (this.moduleTokenCache.has(key)) return this.moduleTokenCache.get(key);

Use:

if (areThereNoFileIn && this.fileIsRequired) {
  return;
}
if (this.moduleTokenCache.has(key)) {
  return this.moduleTokenCache.get(key);
}

This style:

  • Maintains consistent formatting across the codebase
  • Makes code more readable and maintainable
  • Reduces the risk of errors when modifying conditions
  • Makes it easier to add additional statements later without restructuring
5
Comments Analyzed
TypeScript
Primary Language
Code Style
Category

Source Discussions