Skip to content

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

Open
@Deadmano

Description

@Deadmano

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" }
    }
  }
]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions