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

🐛 require-hyphen-before-param-description removes templates default types #1326

Closed
scagood opened this issue Oct 14, 2024 · 1 comment · Fixed by #1327
Closed

🐛 require-hyphen-before-param-description removes templates default types #1326

scagood opened this issue Oct 14, 2024 · 1 comment · Fixed by #1327

Comments

@scagood
Copy link

scagood commented Oct 14, 2024

Code sample -- Before '--fix'

/**
 * @template [O=unknown]
 * @param {string} name The name of the thing.
 */
function test(name) {}

Expected behavior -- After '--fix'

/**
 * @template [O=unknown]
 * @param {string} name - The name of the thing.
 */
function test(name) {}

Actual behavior -- After '--fix'

/**
 * @template O
 * @param {string} name - The name of the thing.
 */
function test(name) {}

ESLint Config

import jsdoc from 'eslint-plugin-jsdoc';

export default [
  {
    plugins: { jsdoc },
    rules: {
      'jsdoc/require-hyphen-before-param-description': 'error',
    }
  }
];

Reproduction

To reproduce, click 'Apply Fix' on the src/example.js file.

https://eslint-online-playground.netlify.app/#eNqtUT1PwzAQ/SsnL4GqSRCIpRUSA3sXJIa6Q+pcErfJ2dgOFEX57/gjVGJhYrHu7j3fu3c3MWtEiZdq0D0WJ8s2rFytOMEKnh36YuUQ9runkc6kPumQEF2ZaoDJOiOpnYGqAeG1wxSoBpyPXeexIvBLTs1IwklF4NC6N+k6NbrdTaDfwjRz4vTvqlf+bgZ1PKFwkfz3WGmm9fIhzcbWDG0vyRVCUSPbYohrkoNWxsHJ1kpAY9QAWaLluh9bSXlEsm0wh5fIrbGpxt7B3svDFB6ARLYbmJZW8zoBZuwxlFMGkEW4NPg+SoN596U7pPyIjfJZtJrXaIWROjjKNn4cY5TJlnbeSHwOW+9HV+JcteHeiryVqMFZjR8vqJFqJCHRcnZV58sGQomzcB3r46XzD/jLd2I+3hUPxT1ni/bM5m8vKtSR

brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Oct 14, 2024
… be properly stringified; fixes gajus#1326

Note that `match-name` will now have to take into account any optional brackets and default in `allowName`
Copy link

🎉 This issue has been resolved in version 50.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants