← ClaudeAtlas

typescript-jsdoclisted

Write effective JSDoc comments for TypeScript code. Provides guidance on documentation format, strategic placement, best practices, and when to document versus when to keep code self-documenting. Helps maintain code clarity and IDE support.
aiskillstore/marketplace · ★ 329 · Code & Development · score 79
Install: claude install-skill aiskillstore/marketplace
# TypeScript JSDoc Documentation Write effective JSDoc comments that enhance code maintainability and provide valuable context to developers and IDEs. ## Core Format JSDoc comments begin with `/**` and end with `*/`, with lines inside typically starting with an asterisk. Tags start with `@` followed by a keyword. Essential tags include `@param`, `@returns`, `@throws`, `@example`, and `@deprecated`. Since TypeScript code already contains type information, JSDoc should focus on the "why" and "how" rather than repeating types: ```typescript /** * Calculates the total price including tax * @param basePrice - The price before tax * @param taxRate - The tax rate as a decimal (0.08 for 8%) * @returns The total price after applying tax */ function calculateTotal(basePrice: number, taxRate: number): number { return basePrice * (1 + taxRate); } ``` ## Strategic Documentation Levels Treat JSDoc usage as having three distinct levels, each serving different purposes: **Essential Documentation** appears on all public APIs, exported functions, classes, and interfaces. This is non-negotiable for library code or shared modules. Document what the entity does, important behaviors, potential errors, and provide a usage example when the interface isn't immediately obvious. **Clarifying Documentation** becomes valuable when code has non-obvious behavior, implements complex algorithms, or has important side effects. Explain critical behaviors that aren't apparent from the signatur