Back to all reviewers

Enhance code clarity

TanStack/router
Based on 6 comments
Markdown

Ensure all code examples and documentation are as clear and complete as possible for developers. This includes adding clarifying inline comments to explain non-obvious behavior, including all necessary import statements, and structuring information for maximum readability.

React Markdown

Reviewer Prompt

Ensure all code examples and documentation are as clear and complete as possible for developers. This includes adding clarifying inline comments to explain non-obvious behavior, including all necessary import statements, and structuring information for maximum readability.

Key practices:

  • Add inline comments to clarify behavior, especially for files or configurations that might be confusing (e.g., // ๐Ÿ‘ˆ๐Ÿผ ignored for excluded files)
  • Include complete import statements in code examples rather than assuming developers know what to import
  • Break complex statements into separate, digestible points
  • Use proper grammar and standard abbreviations (e.g., โ€œi.e.โ€ not โ€œieโ€)

Example of good clarity:

// Include all imports
import { Link, createLink } from '@tanstack/react-router'
import { Button } from '@mui/material'

// Clear file structure with explanatory comments
routes/
โ”œโ”€โ”€ posts.tsx
โ”œโ”€โ”€ -posts-table.tsx // ๐Ÿ‘ˆ๐Ÿผ ignored from route generation
โ”œโ”€โ”€ -components/
โ”‚   โ”œโ”€โ”€ header.tsx // ๐Ÿ‘ˆ๐Ÿผ ignored from route generation
โ”‚   โ””โ”€โ”€ footer.tsx // ๐Ÿ‘ˆ๐Ÿผ ignored from route generation

This approach reduces confusion, speeds up developer onboarding, and prevents common implementation mistakes by making examples self-contained and immediately understandable.

6
Comments Analyzed
Markdown
Primary Language
React
Category

Source Discussions