Registry / testing / prettier-plugin-jsdoc

prettier-plugin-jsdoc

JSON →
library1.8.0jsnpmunverified

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-jsdoc
INSTALL
IMPORT
SIG · PRETTIER-PLUGIN-JS
P
prettier-plugin-jsdoc
testingjavascriptv1.8.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

prettier-plugin-jsdoc
Add to .prettierrc plugins array: "plugins": ["prettier-plugin-jsdoc"]
import prettierPluginJsdoc from 'prettier-plugin-jsdoc'; // Not a programmatic import, it's a plugin
Plugin is loaded via Prettier configuration, not imported directly in code.

Installs the plugin, adds it to Prettier config, and formats a JSDoc comment from messy to clean.

// 1. Install: npm install --save-dev prettier prettier-plugin-jsdoc // 2. .prettierrc: { "plugins": ["prettier-plugin-jsdoc"] } // 3. Input file (example.js): /** * @param { string } name description */ function greet(name) {} // 4. Run: npx prettier --write example.js // Output: /** @param {string} name Description */ function greet(name) {}
Debug
Known issues
breakingprettier-plugin-jsdoc v1.0.0 requires Prettier v3 (ESM-only). Prettier v2 is not supported.
fix
Upgrade Prettier to v3: npm install prettier@latest --save-dev
affects: >=1.0.0
deprecatedUses 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.
fix
Use standard JSDoc tags: @param, @returns, @type, @typedef, etc.
affects: all
gotchaWhen using multiple Prettier plugins, prettier-plugin-jsdoc must be placed at the end of the plugins list.
fix
Order plugins: [..., 'prettier-plugin-jsdoc']
affects: all
breakingIn v0.x, the plugin was CommonJS. Starting v1.0.0, it is ESM-only.
fix
Ensure your project uses ESM (type: "module" in package.json) or adjust Prettier configuration accordingly.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'prettier-plugin-jsdoc'
Plugin not installed or not resolved by Prettier.
fix
Run: npm install --save-dev prettier-plugin-jsdoc
Error: Requires Prettier >= 3.0.0
Installed Prettier version is too old.
fix
Upgrade Prettier: npm install prettier@latest --save-dev
TypeError: prettier-plugin-jsdoc is not a function
Incorrectly trying to import the plugin as a module instead of configuring it in .prettierrc.
fix
Remove any import of prettier-plugin-jsdoc from code; add it to Prettier config plugins array.
Upgrade
Version history
1.8.0latest on npm
Audit
Dependencies
prettierrequiredpeer dependency: plugin requires Prettier >=3.0.0 to function
Agent activity
4 hits · last 30 days
node
4
Resources
prettier-plugin-jsdoc — npm install prettier-plugin-jsdoc · libregistry