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

jsdoc/require-jsdoc - publicOnly not working with require.MethodDefinition #1124

Closed
reececomo opened this issue Jun 28, 2023 · 2 comments · Fixed by #1125
Closed

jsdoc/require-jsdoc - publicOnly not working with require.MethodDefinition #1124

reececomo opened this issue Jun 28, 2023 · 2 comments · Fixed by #1125

Comments

@reececomo
Copy link

Split from #1122.

Expected behavior

When using jsdoc/require-jsdoc I would expect publicOnly and require.MethodDefinition together to mean that public methods required docs.

Actual behavior

Private/protected methods are also failing the lint check too (unexpectedly).

I imagine this issue unexpectedly would apply to other require. properties or context. options too.

ESLint Config

    "jsdoc/require-jsdoc": [
      'error',
      {
        checkConstructors: false,
        publicOnly: true,
        require: {
          'MethodDefinition': true
        }
      }
    ],

ESLint sample

export class MyClass {

  public myPublicMethod(): void { }
      /* ^ Missing JSDoc comment. eslint(jsdoc/require-jsdoc) - expected ✅ */

  private myPrivateMethod(): void { }
       /* ^ Missing JSDoc comment. eslint(jsdoc/require-jsdoc) - unexpected ❌ */

  // ...
}

Environment

  • Node version: ^16.16.0
  • ESLint version: 8.43.0
  • eslint-plugin-jsdoc version: 46.4.1
@github-actions
Copy link

🎉 This issue has been resolved in version 46.4.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@reececomo
Copy link
Author

Thank you @brettz9!

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