Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unstable formatting for "Default value" #219

Open
GulDilin opened this issue Nov 24, 2023 · 0 comments
Open

Unstable formatting for "Default value" #219

GulDilin opened this issue Nov 24, 2023 · 0 comments

Comments

@GulDilin
Copy link

Hello. Thank you for developing this tool.

I faced an issue with the formatted jsdoc result changing over multiple runs for the "Default is" part. The "Default is false" part is added on each run.

Example

Imput code

/**
 * Compute some value
 *
 * @param {Object} param The parameters
 * @param {boolean} [param.isSelectedSomeVal=false] Indicates if selected
 *
 * @returns {string} SomeValue
 */
export const computeSomeValue = ({ isSelectedSomeVal = false }) => {
  // some code
  return undefined
}

Output after run 1

/**
 * Compute some value
 *
 * @param {Object} param The parameters
 * @param {boolean} [param.isSelectedSomeVal=false] Indicates if selected Default is `false`
 *
 * @returns {string} SomeValue
 */
export const computeSomeValue = ({ isSelectedSomeVal = false }) => {
  // some code
  return undefined
}

Expected

// same as output after run 1

Output after run 3

/**
 * Compute some value
 *
 * @param {Object} param The parameters
 * @param {boolean} [param.isSelectedSomeVal=false] Indicates if selected Default is `false` Default
 *   is `false` Default is `false`
 *
 * @returns {string} SomeValue
 */
export const computeSomeValue = ({ isSelectedSomeVal = false }) => {
  // some code
  return undefined
}

Environment

Versions

node
v19.9.0

"prettier": "3.1.0",
"prettier-plugin-jsdoc": "1.1.1"

.prettierrc

{
    "plugins": [
      "prettier-plugin-jsdoc"
    ],
    "trailingComma": "es5",
    "tabWidth": 2,
    "semi": false,
    "singleQuote": true,
    "singleAttributePerLine": true,
    "bracketSameLine": false,
    "arrowParens": "avoid",
    "printWidth": 100,
    "endOfLine": "lf",

    "jsdocVerticalAlignment": false,
    "jsdocKeepUnParseAbleExampleIndent": false,
    "jsdocSeparateReturnsFromParam": true,
    "jsdocSeparateTagGroups": true,
    "tsdoc": true,
    "jsdocPrintWidth": 100
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant