hosseinmd / prettier-plugin-jsdoc

A Prettier plugin to format JSDoc comments.
MIT License
232 stars 28 forks source link

Separate tag groups with empty lines #120

Closed angeloashmore closed 3 years ago

angeloashmore commented 3 years ago

Awesome plugin! Thank you for writing and maintaining it. 🙂

Would it be possible to separate groups of @tags with empty lines? This is similar to the option for adding an empty space above @returns, but for each group.

For example (with TSDoc)…

Current output:

    /**
     * Queries a document from the Prismic repository with a specific UID and Custom Type.
     *
     * @remarks
     * A document's UID is different from its ID. An ID is automatically generated
     * for all documents and is made available on its `id` property. A UID is
     * provided in the Prismic editor and is unique among all documents of its Custom Type.
     * @example
     *
     * ```ts
     * const document = await client.getByUID("blog_post", "my-first-post");
     * ```
     *
     * @typeParam TDocument - Type of the Prismic document returned.
     * @param documentType - The API ID of the document's Custom Type.
     * @param uid - UID of the document.
     * @param params - Parameters to filter, sort, and paginate the results.
     *
     * @returns The document with a UID matching the `uid` parameter, if a
     *   matching document exists.
     */

Desired output:

    /**
     * Queries a document from the Prismic repository with a specific UID and Custom Type.
     *
     * @remarks
     * A document's UID is different from its ID. An ID is automatically generated
     * for all documents and is made available on its `id` property. A UID is
     * provided in the Prismic editor and is unique among all documents of its Custom Type.
     * 
     * @example
     *
     * ```ts
     * const document = await client.getByUID("blog_post", "my-first-post");
     * ```
     *
     * @typeParam TDocument - Type of the Prismic document returned.
     * 
     * @param documentType - The API ID of the document's Custom Type.
     * @param uid - UID of the document.
     * @param params - Parameters to filter, sort, and paginate the results.
     *
     * @returns The document with a UID matching the `uid` parameter, if a
     *   matching document exists.
     */
hosseinmd commented 3 years ago

LGTM, but unfortunately I don't have time, I will try to do it as soon as possible.

angeloashmore commented 3 years ago

@hosseinmd Of course! I'll try to find time and maybe make a PR as well.

hosseinmd commented 3 years ago

Released in v0.3.28 https://github.com/hosseinmd/prettier-plugin-jsdoc/commit/e51d0e8d63f19a54acf26563d9dcc9036e42452e

angeloashmore commented 3 years ago

That's great, thank you @hosseinmd!