{"id":20379,"library":"prettier-plugin-jsdoc","title":"prettier-plugin-jsdoc","description":"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.","status":"active","version":"1.8.0","language":"javascript","source_language":"en","source_url":"https://github.com/hosseinmd/prettier-plugin-jsdoc","tags":["javascript","prettier","plugin","jsdoc","comment","typescript"],"install":[{"cmd":"npm install prettier-plugin-jsdoc","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-plugin-jsdoc","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-plugin-jsdoc","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: plugin requires Prettier >=3.0.0 to function","package":"prettier","optional":false}],"imports":[{"note":"Plugin is loaded via Prettier configuration, not imported directly in code.","wrong":"import prettierPluginJsdoc from 'prettier-plugin-jsdoc'; // Not a programmatic import, it's a plugin","symbol":"prettier-plugin-jsdoc","correct":"Add to .prettierrc plugins array: \"plugins\": [\"prettier-plugin-jsdoc\"]"}],"quickstart":{"code":"// 1. Install: npm install --save-dev prettier prettier-plugin-jsdoc\n// 2. .prettierrc:\n{\n  \"plugins\": [\"prettier-plugin-jsdoc\"]\n}\n// 3. Input file (example.js):\n/**\n * @param {  string   }    name description\n */\nfunction greet(name) {}\n// 4. Run: npx prettier --write example.js\n// Output:\n/** @param {string} name Description */\nfunction greet(name) {}\n","lang":"javascript","description":"Installs the plugin, adds it to Prettier config, and formats a JSDoc comment from messy to clean."},"warnings":[{"fix":"Upgrade Prettier to v3: npm install prettier@latest --save-dev","message":"prettier-plugin-jsdoc v1.0.0 requires Prettier v3 (ESM-only). Prettier v2 is not supported.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use standard JSDoc tags: @param, @returns, @type, @typedef, etc.","message":"Uses of @exception, @return, @returns, @augments, @extends, @typeparam, @borrows, @constructs, @default, @external, @host, @fileoverview, @overview, @class, @const, @defaultvalue, @desc, @emits, @exception, @func, @host, @interface, @kind, @method, @prop, @returns, @see, @summary, @this, @throws, @type, @typedef, @var, @yields are deprecated in favor of standard tags.","severity":"deprecated","affected_versions":"all"},{"fix":"Order plugins: [..., 'prettier-plugin-jsdoc']","message":"When using multiple Prettier plugins, prettier-plugin-jsdoc must be placed at the end of the plugins list.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure your project uses ESM (type: \"module\" in package.json) or adjust Prettier configuration accordingly.","message":"In v0.x, the plugin was CommonJS. Starting v1.0.0, it is ESM-only.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run: npm install --save-dev prettier-plugin-jsdoc","cause":"Plugin not installed or not resolved by Prettier.","error":"Error: Cannot find module 'prettier-plugin-jsdoc'"},{"fix":"Upgrade Prettier: npm install prettier@latest --save-dev","cause":"Installed Prettier version is too old.","error":"Error: Requires Prettier >= 3.0.0"},{"fix":"Remove any import of prettier-plugin-jsdoc from code; add it to Prettier config plugins array.","cause":"Incorrectly trying to import the plugin as a module instead of configuring it in .prettierrc.","error":"TypeError: prettier-plugin-jsdoc is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}