
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
prettier-plugin-jsdoc
Advanced tools
Prettier plugin for formatting comment blocks and converting to a standard. Match with Visual Studio Code and other IDEs that support JSDoc and comments as Markdown.
Many good examples of how this plugin works are in the /tests directory.
Compare tests and their snapshots.
Configured with best practices of JSDoc style guides.
npm install prettier-plugin-jsdoc --save-dev
yarn add prettier-plugin-jsdoc --dev
Add prettier-plugin-jsdoc to your plugins list.
.prettierrc:
{
"plugins": ["prettier-plugin-jsdoc"]
}
prettier.config.js:
export default {
plugins: ["prettier-plugin-jsdoc"],
}
If you want to ignore some types of files, use overrides with an empty plugins:
{
"plugins": ["prettier-plugin-jsdoc"],
"overrides": [
{
"files": "*.tsx",
"options": {
"plugins": []
}
}
]
}
To prevent Prettier from formatting, use /* */ or // instead of /** */, or see Ignoring Code.
/**
* @param { string } param0 description
*/
function fun(param0) {}
Formats to:
/** @param {string} param0 Description */
function fun(param0) {}
/**
* @type {React.FC<{ message:string} >}
*/
const Component = memo(({ message }) => {
return <p>{message}</p>;
});
Formats to:
/** @type {React.FC<{message: string}>} */
const Component = memo(({ message }) => {
return <p>{message}</p>;
});
/**
@typedef {
{
"userId": {
"profileImageLink": *,
"isBusinessUser": "isResellerUser"|"isBoolean"| "isSubUser" | "isNot",
"shareCode": number,
"referredBy": any,
},
id:number
}
} User
*/
Format to:
/**
* @typedef {{
* userId: {
* profileImageLink: any;
* isBusinessUser: "isResellerUser" | "isBoolean" | "isSubUser" | "isNot";
* shareCode: number;
* referredBy: any;
* };
* id: number;
* }} User
*/
Add code to @examples tag.
/**
* @examples
* var one= 5
* var two=10
*
* if(one > 2) { two += one }
*/
Formats to:
/**
* @example
* var one = 5;
* var two = 10;
*
* if (one > 2) {
* two += one;
* }
*/
@description is formatted as Markdown so that you can use any features of Markdown on that.
Like code tags (```js), header tags like # Header, or other Markdown features.
| Key | Type | Default | Description |
|---|---|---|---|
jsdocSpaces | Number | 1 | |
jsdocDescriptionWithDot | Boolean | false | |
jsdocDescriptionTag | Boolean | false | |
jsdocVerticalAlignment | Boolean | false | |
jsdocKeepUnParseAbleExampleIndent | Boolean | false | |
jsdocCommentLineStrategy | ("singleLine","multiline","keep") | "singleLine" | |
jsdocCapitalizeDescription | Boolean | true | |
jsdocSeparateReturnsFromParam | Boolean | false | Adds a space between last @param and @returns |
jsdocSeparateTagGroups | Boolean | false | Adds a space between tag groups |
jsdocPreferCodeFences | Boolean | false | Always fence code blocks (surround them by triple backticks) |
tsdoc | Boolean | false | See TSDoc |
jsdocPrintWidth | Number | undefined | If you don't set the value to jsdocPrintWidth, printWidth will be used as jsdocPrintWidth |
jsdocLineWrappingStyle | String | "greedy" | "greedy": lines wrap as soon as they reach printWidth |
jsdocTagsOrder | String (object) | undefined | See Custom Tags Order |
We hope to support the whole TSDoc. If we missed something, please create an issue.
To enable, add:
{
"tsdoc": true
}
| Plugin version | Prettier version |
|---|---|
| 1.0.0+ | 3.0.0+ |
| 0.4.2 | 2.x+ |
Fork and clone the repository
Install project dependencies:
yarn install
Make changes and make sure that tests pass:
yarn run test
Update or add tests to your changes if needed
Create PR
This project extended from the @gum3n worked project on GitLab.
FAQs
A Prettier plugin to format JSDoc comments.
The npm package prettier-plugin-jsdoc receives a total of 176,472 weekly downloads. As such, prettier-plugin-jsdoc popularity was classified as popular.
We found that prettier-plugin-jsdoc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.