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

New Rule: no-multiple-empty-lines #1346

Open
Deadmano opened this issue Jan 6, 2025 · 0 comments
Open

New Rule: no-multiple-empty-lines #1346

Deadmano opened this issue Jan 6, 2025 · 0 comments

Comments

@Deadmano
Copy link

Deadmano commented Jan 6, 2025

Motivation

There currently does not appear to be a way to enforce at most a single blank line within a multiline block. The tag-lines rule allows you to enforce a minimum count between lines, but there is no maximum equivalent.

Current behavior

There does not appear to be a way to limit the amount of empty lines within a block comment.

Desired behavior

The ability to limit the amount of empty lines within a block comment. A new rule could be created, or a maximum option added to tag-lines to specify the maximum amount of empty lines allowed between lines in a block comment.

If going with the addition to tag-lines, consider the following failing example:

 * Some description.
 * 
 *
 * @param {string} a
 * @param {number} b
 */
// "jsdoc/tag-lines": ["error"|"warn", "always", {"maxCount": 1}]
// Message: Expected at most 1 line between tags but found 2

Alternatives considered

I have looked to see if there are other ESLint rules, and have also tried configuring the tag-lines rule as such:

  "error",
  "always",
  {
    "applyToEndTag": false,
    "count": 1,
    "endLines": 0,
    "startLines": 1,
    "tags": {
      "param": { "lines": "never" }
    }
  }
]
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

1 participant