Skip to content

[Regression] jsdoc/no-undefined-types warning for module:stream.Readable #747

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

Closed
kevinoid opened this issue May 31, 2021 · 5 comments
Closed

Comments

@kevinoid
Copy link

Expected behavior

jsdoc/no-undefined-types does not warn for module:stream.Readable.

Actual behavior

index.js:4:0: The type 'Readable' is undefined. [Warning/jsdoc/no-undefined-types]

ESLint Config

{
  "env": {
    "es6": true,
    "node": true
  },
  "extends": [
    "plugin:jsdoc/recommended"
  ]
}

ESLint sample

/**
 * Read all content from a Readable stream.
 *
 * @param {!module:stream.Readable} readable Readable stream.
 * @returns {!Promise<!Array<*>>} Content from readable.
 */
module.exports =
function readStream(readable) {
  return new Promise((resolve, reject) => {
    const data = [];
    readable
      .on('data', (d) => data.push(d))
      .once('error', reject)
      .once('end', () => resolve(data));
  });
};

Environment

  • Node version: v12.21.0
  • ESLint version v7.27.0
  • eslint-plugin-jsdoc version: v35.1.1 or v35.1.0

Additional Info

The issue does not occur with [email protected] or earlier. I bisected the regression to e9f6a0a from #736.

I'm still not entirely clear on what types JSDoc accepts. My apologies in advance if module:stream.Readable is not a valid type.

Thanks,
Kevin

@simonseyock
Copy link
Contributor

Thanks for reporting this! This should be fixed in jsdoc-type-pratt-parser/jsdoc-type-pratt-parser#60.

@kevinoid
Copy link
Author

Thanks for the fast response and fix @simonseyock! Much appreciated. I can confirm that [email protected] fixes the issue for me.

I noticed a couple other potential issues. Would you prefer if I open them in this repo or simonseyock/jsdoc-type-pratt-parser? (Or as comments on this issue?)

@simonseyock
Copy link
Contributor

Feel free to report them on simonseyock/jsdoc-type-pratt-parser

@brettz9
Copy link
Collaborator

brettz9 commented May 31, 2021

@kevinoid , if these are not very obscure issues (like the non-allowance of underscores as was just fixed in the parser), feel free to also file here so others can see here that it is being worked on and so that we can track our updating of the parser once it may include a fix/enhancement.

@gajus
Copy link
Owner

gajus commented Jun 6, 2021

🎉 This issue has been resolved in version 35.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Jun 6, 2021
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

4 participants