Skip to content

64.2.1: no-blank-block-descriptions fails to remove a leading empty line appearing before description content #1748

Description

@lkraav

Related #982

Expected behavior

Remove leading empty line appearing before description content

Actual behavior

Empty line stays

ESLint Config

import jsdoc from 'eslint-plugin-jsdoc';

{
    plugins: {
      jsdoc,
    },
    rules: {
      'jsdoc/no-blank-block-descriptions': 2,
    }
}

ESLint sample

/**
 *
 * Seniority levels that participate in distribution, in display
 * order. `custom` is never a real distribution key. Every test shown in this
 * modal can recruit each of these levels, so all three are always editable.
 */
const SENIORITY_ORDER = ['senior', 'middle', 'specialist'];

For some reason I don't see this case tested at https://github.com/gajus/eslint-plugin-jsdoc/blob/v64.2.1/docs/rules/no-blank-block-descriptions.md

Side quest: this is a result of convert-to-jsdoc-comments auto-fix, if there's bandwidth to look at that.

The fixer unconditionally prepends /\n${indent}* to the raw, unmodified comment.value.
comment.value is literally "\n * Seniority levels...\n */" (i.e. it already starts with \n * ). So the fixer glues /
\n * + \n * Seniority levels... together — producing two newline+* sequences back to back, which is exactly the empty \n *\n line you're seeing. It never strips/dedupes the original leading \n * before re-prefixing its own.

Environment

  • Node version: 24.19
  • ESLint version: 9.39.4
  • eslint-plugin-jsdoc version: 64.2.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions