Skip to content

Remove leading empty lines in descriptions. #982

@jespertheend

Description

@jespertheend

Motivation

VSCode automatically adds an empty line at the start of JSDoc comments, but I don't necessarily always want to add a description, so sometimes I end up with comments like these:

/**
 *
 * @param {number} x
 */
function functionWithClearName(x) {}

Current behavior

No errors.

Desired behavior

An error with autofix that removes the empty line:

/**
 * @param {number} x
 */
function functionWithClearName(x) {}

Alternatives considered

I'm using match-description for now:

"jsdoc/match-description": ["error", {
	matchDescription:"^\\S",
	message: "JSDoc comments may not start with an emtpy line.",
}],

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions