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

/** in @param description causes false errors #568

Closed
jaydenseric opened this issue Jun 7, 2020 · 2 comments
Closed

/** in @param description causes false errors #568

jaydenseric opened this issue Jun 7, 2020 · 2 comments

Comments

@jaydenseric
Copy link
Contributor

jaydenseric commented Jun 7, 2020

Using /** in a JSDoc @param description for a function causes false errors, that when autofixed, deletes most of the existing JSDoc.

I actually need to be able to write inline code containing this because I'm documenting code to do with authoring JSDoc. It's expected that a multiline comment end (*/) needs to be escaped (*\/) to prevent the JSDoc comment block from closing early, but it is unexpected to have to also escape comment starts (/** -> /\**).

Expected behavior

With this function and the jsdoc/require-param rule enabled:

/**
 * Description.
 * @param {string} b Description `/**`.
 */
module.exports = function a(b) {
  console.info(b);
};

There should be no errors.

Actual behavior

There is a jsdoc/require-param error:

Missing JSDoc @param "b" declaration.

It autofixes to this:

/**
 * `.
 * @param b
 */
module.exports = function a(b) {
  console.info(b);
};

ESLint Config

{
  "rules": {
    "jsdoc/require-param": "error"
  }
}

ESLint sample

See above reproduction steps.

Environment

  • Node version: v14.3.0
  • ESLint version v7.1.0
  • eslint-plugin-jsdoc version: v27.0.4
@brettz9
Copy link
Collaborator

brettz9 commented Jun 7, 2020

This is an issue in the underlying comment-parser. Please follow at syavorsky/comment-parser#89 . Closing here, as we tend to update fairly frequently (once that may be fixed).

@brettz9 brettz9 closed this as completed Jun 7, 2020
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Aug 16, 2020
…`comment-parser` adjustment would otherwise not wholly remove the default; also updates devDeps and tests use of opening jsdoc; fixes gajus#568
@gajus
Copy link
Owner

gajus commented Aug 16, 2020

🎉 This issue has been resolved in version 30.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants