gajus / eslint-plugin-jsdoc

JSDoc specific linting rules for ESLint.
Other
1.1k stars 160 forks source link

jsdoc/require-jsdoc - publicOnly not working with private methods (using #) #1212

Closed aws-sde closed 8 months ago

aws-sde commented 8 months ago

This is similar to https://github.com/gajus/eslint-plugin-jsdoc/issues/1124 but it's using # instead of TypeScript's private

Expected behavior

When jsdoc/require-jsdoc is configured with publicOnly: true for method definitions, there should be no error for private methods that lack docs.

Actual behavior

When jsdoc/require-jsdoc is configured with publicOnly: true for method definitions, it gives an error for private methods (prefixed with #) that lack docs.

ESLint Config

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

ESLint sample

export class MyClass {
  #myPrivateMethod(): void { }
}

Environment

github-actions[bot] commented 8 months ago

:tada: This issue has been resolved in version 48.2.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: