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

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

Open
ehoogeveen-medweb opened this issue Aug 7, 2024 · 1 comment

Comments

@ehoogeveen-medweb
Copy link

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.

@brettz9 brettz9 changed the title Options for lines-before-comment to ignore the beginning of a class, function or other block Options for lines-before-block to ignore the beginning of a class, function or other block Aug 7, 2024
@JoshuaKGoldberg
Copy link
Contributor

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.

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

2 participants