Back to all reviewers

Document with precise accuracy

nodejs/node
Based on 5 comments
JavaScript

Maintain precise and accurate documentation through both JSDoc annotations and explanatory comments. Ensure all technical documentation matches the actual implementation, avoiding inconsistencies between code and documentation.

Documentation JavaScript

Reviewer Prompt

Maintain precise and accurate documentation through both JSDoc annotations and explanatory comments. Ensure all technical documentation matches the actual implementation, avoiding inconsistencies between code and documentation.

Key practices:

  1. Keep JSDoc parameter and return types strictly accurate
  2. Avoid default values in JSDoc to prevent inconsistencies
  3. Document unusual patterns or complex implementations
  4. Include clear examples for non-obvious functionality

Example: ```javascript /**

  • Format help text for printing.
  • @param {string} longOption - long option name e.g. ‘foo’
  • @param {object} optionConfig - option config from parseArgs({ options })
  • @returns {string} formatted help text for printing
  • @example
  • formatHelpTextForPrint(‘foo’, { type: ‘string’, help: ‘help text’ })
  • // returns ‘–foo help text' */ function formatHelpTextForPrint(longOption, optionConfig) { // Implementation using unusual pattern - explain why if (isSpecialCase(optionConfig)) { // Document why this special case exists // and how it affects the output } // ... rest of implementation }
5
Comments Analyzed
JavaScript
Primary Language
Documentation
Category

Source Discussions