hosseinmd / prettier-plugin-jsdoc

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

disable semi only in jsdoc #232

Closed eduardocque closed 4 months ago

eduardocque commented 4 months ago

Hi, is there a way to disable semicolon only in jsdoc ?

im trying to use this plugin but when im running jsdoc is crashing with this error

ERROR: Unable to parse a tag's type expression for source file xxx.js in line 24 with tag title "param" and text "{{
  children: React.ReactNode;
  value: any;
}} props": Invalid type expression "{
  children: React.ReactNode;
  value: any;
}": Expected "!", "#", "$", "(", ",", "-", ".", "/", "0", ":", "<", "=", "?", "@", "[]", "\\", "_", "|", "}", "~", "‌", "‍", Unicode combining mark, Unicode decimal number, Unicode letter number, Unicode lowercase letter, Unicode modifier letter, Unicode other letter, Unicode punctuation connector, Unicode titlecase letter, Unicode uppercase letter, or [1-9] but ";" found.
/**
 * @param {{
 *   children: React.ReactNode;
 *   value: any;
 * }} props
 * @returns {React.ReactElement}
 */

should be

/**
 * @param {{
 *   children: React.ReactNode,
 *   value: any
 * }} props
 * @returns {React.ReactElement}
 */
hosseinmd commented 4 months ago

It is because of typescript, I can't change it. Which package is crashing?

eduardocque commented 4 months ago

@hosseinmd jsdoc fails, noticed that the normal prettier with semi is trying to put ; everywhere like the example and should be , like the second example, when is the second example jsdoc works well

just to confirm, im using javascript

hosseinmd commented 4 months ago

I know, but the code into curly brackets is type and formatted as typescript code.

hosseinmd commented 4 months ago
/**
 * @param {here is type} props
 */
eduardocque commented 4 months ago

what can i do in that case ? im trying to autogenerate docs with jsdoc ?

hosseinmd commented 4 months ago

I hope jsdoc could fix it. Create an issue in jsdoc repo, and I will follow up too.