Skip to content

[Rule] check-alignment fix insert a letter multiple times #1322

@joris-fonck-loreal

Description

@joris-fonck-loreal

Expected behavior

I don't know if it's a bug or a behavior do to formatting.

When I start a comment at the declaration line of a variable, and I lint my code, the first letter of the declaration line is inserted in the comment. Expected behavior: letters should not be inserted.

export const myVar = {/**
  * This is JSDoc
  */
  myProperty: 'hello'
}

Actual behavior

A letter is inserted in the comment. The inserted letter is the first letter of the declaration line (e for export):

export const myVar = {/**
eeeeeeeeeeeeeeeeeeeeee * This is JSDoc
eeeeeeeeeeeeeeeeeeeeee */
  myProperty: 'hello'
}

Another example for const:

const myVar = {/**
cccccccccccccccccccccc * This is JSDoc
cccccccccccccccccccccc */
  myProperty: 'hello'
}

ESLint Config

Here is a repro: https://github.com/joris-fonck-loreal/eslint-plugin-jsdoc-repro

Environment

  • Node version: 20.0.0
  • ESLint version: 9.11.1
  • eslint-plugin-jsdoc version: 50.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions