Back to all reviewers

Write clear documentation

fastify/fastify
Based on 8 comments
Markdown

Documentation should be clear, precise, and self-contained while following established style conventions. When writing technical documentation, use precise language, make documentation self-contained, follow style conventions, and create accessible links.

Documentation Markdown

Reviewer Prompt

Documentation should be clear, precise, and self-contained while following established style conventions. When writing technical documentation:

  1. Use precise language: Clearly describe how APIs work, including any restrictions or requirements.
    // Good
    // The function must be synchronous, and must not throw an error.
    fastify.setGenReqId(function (rawReq) { return 'request-id' })
       
    // Bad
    // This function can be used to set a request ID.
    fastify.setGenReqId(function (rawReq) { return 'request-id' })
    
  2. Make documentation self-contained: Include all necessary context within the document itself rather than relying on external links.
    // Good
    // The `preHandler` hook allows you to specify a function that is executed before
    // routes' handler.
       
    // Bad
    // See Issue #1234 for more details on the preHandler hook.
    
  3. Follow style conventions:
    • Avoid using “you” in reference documentation
    • Avoid contractions in formal documentation
    • Use proper formatting for headers, lists, and code blocks
    // Good
    // When request logging is enabled, request logs can be customized by
    // supplying a createRequestLogMessage() function.
       
    // Bad
    // You can customize your request logs by using a createRequestLogMessage() function.
    
  4. Create accessible links: Provide meaningful context in link text rather than using generic phrases.
    <!-- Good -->
    [TypeScript no-floating-promises configuration](https://typescript-eslint.io/rules/no-floating-promises/)
       
    <!-- Bad -->
    Click [here](https://typescript-eslint.io/rules/no-floating-promises/) for more information.
    
8
Comments Analyzed
Markdown
Primary Language
Documentation
Category

Source Discussions