hosseinmd / prettier-plugin-jsdoc

A Prettier plugin to format JSDoc comments.
MIT License
228 stars 29 forks source link

@example code block format not right #225

Closed tjx666 closed 7 months ago

tjx666 commented 8 months ago

source:

const obj = {
    /**
     * @example
     * ```javascript
     *  {
     *      axios: ['0.17.4', '1.4.0']
     *  }
     *  ```
     *
     * @default { }
     */
    a: 1
}

result: Why here useless indent and the semi?

const obj = {
    /**
     * @example
     *     ```javascript
     *      {
     *          axios: ['0.17.4', '1.4.0']
     *      }
     *      ```;
     *
     * @default { }
     */
    a: 1,
};

Versions:

"prettier": "^3.2.4",
"prettier-plugin-jsdoc": "^1.1.1"

`

hosseinmd commented 7 months ago

Example should be this

const obj = {
    /**
     * @example
     *  {
     *      axios: ['0.17.4', '1.4.0']
     *  }
     *
     * @default { }
     */
    a: 1
}

or

const obj = {
    /**
     * ```javascript
     *  {
     *      axios: ['0.17.4', '1.4.0']
     *  }
     *  ```
     *
     * @default { }
     */
    a: 1
}