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

Documenting an object parameter with the name module triggers jsdoc/valid-types #806

Closed
edg2s opened this issue Nov 8, 2021 · 5 comments

Comments

@edg2s
Copy link
Contributor

edg2s commented Nov 8, 2021

Expected behavior

No error is found in the code example

Actual behavior

An error is reported from the line containing * @param {string} options.module:

Syntax error in namepath: options.module

ESLint Config

{
  "jsdoc/valid-types": "error"
}

ESLint sample

/**
 * @param {string} id
 * @param {Object} options
 * @param {boolean} options.isSet
 * @param {string} options.module
 */
function ( id, options ) {
}

Environment

  • Node version:
  • ESLint version
  • eslint-plugin-jsdoc version: 37.0.3
@brettz9
Copy link
Collaborator

brettz9 commented Nov 8, 2021

I think this might be an issue for jsdoc-type-pratt-parser (for not allowing "module" in this position)... @simonseyock ?

As a workaround, you can use jsdoc's escaping mechanism:

* @param {string} options."module"

@dog-s-life
Copy link

dog-s-life commented Nov 16, 2021

Same issue for external.

/**
 * @param {boolean} requestBody.external blah blah.
 */

@c69-addepar
Copy link

i have filed the same issue for parser, it reproduces consistently:
jsdoc-type-pratt-parser/jsdoc-type-pratt-parser#102

But not sure if the actual a bug is in parser, or in this plugin.

@brettz9
Copy link
Collaborator

brettz9 commented Dec 18, 2021

Closing as tracking to be done in jsdoc-type-pratt-parser. (We regularly update, and if we don't just ping us.)

@brettz9 brettz9 closed this as completed Dec 18, 2021
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 28, 2021
…ule" as child fix; fixes gajus#806

Also updates devDeps. and updates linting
@gajus
Copy link
Owner

gajus commented Dec 28, 2021

🎉 This issue has been resolved in version 37.4.1 🎉

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
Development

No branches or pull requests

5 participants