A Prettier plugin (v1.8.0) that formats JSDoc comment blocks, converting them to a consistent style. Written in TypeScript, requires Prettier ^3.0.0 and Node >=14.13.1. It supports standard JSDoc tags, Markdown in descriptions, @example code blocks, TypeScript type definitions, and React prop types. Unlike alternative formatters (e.g., eslint-plugin-jsdoc), this integrates directly with Prettier as a plugin, ensuring zero-config formatting in editors and CI. Actively maintained with frequent releases.
npm install prettier-plugin-jsdocVerified import paths — ran on the pinned version, not inferred.
Installs the plugin, adds it to Prettier config, and formats a JSDoc comment from messy to clean.
Upgrade Prettier to v3: npm install prettier@latest --save-dev
Use standard JSDoc tags: @param, @returns, @type, @typedef, etc.
Order plugins: [..., 'prettier-plugin-jsdoc']
Ensure your project uses ESM (type: "module" in package.json) or adjust Prettier configuration accordingly.
Run: npm install --save-dev prettier-plugin-jsdoc
Upgrade Prettier: npm install prettier@latest --save-dev
Remove any import of prettier-plugin-jsdoc from code; add it to Prettier config plugins array.