gajus / eslint-plugin-jsdoc

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

Options for `lines-before-block` to ignore the beginning of a class, function or other block #1296

Closed ehoogeveen-medweb closed 1 day ago

ehoogeveen-medweb commented 3 months ago

Motivation

For example:

class MyClass {
  /**
   * Description of member function.
   */
  outerFunc() {
    /**
     * Description of inner function.
     */
    innerFunc() { }

    return innerFunc;
  }
}

Compare the options in the ESLint Stylistic rule lines-around-comment and the typescript variant.

Current behavior

Warns about jsdoc comments immediately after the start of a class/function/block.

Desired behavior

Options not to warn about those positions.

JoshuaKGoldberg commented 3 months ago

IMO this is a bug, or at least an option that should be enabled by default. It's very rare and nitpicky that projects would enforce the start of the first JSDoc comment in a {} block need a blank line above it.

github-actions[bot] commented 1 day ago

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

The release is available on:

Your semantic-release bot :package::rocket: