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

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

Closed
joris-fonck-loreal opened this issue Oct 1, 2024 · 3 comments · Fixed by #1323
Closed

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

joris-fonck-loreal opened this issue Oct 1, 2024 · 3 comments · Fixed by #1323
Labels

Comments

@joris-fonck-loreal
Copy link

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
Copy link

github-actions bot commented Oct 1, 2024

🎉 This issue has been resolved in version 50.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@brettz9
Copy link
Collaborator

brettz9 commented Oct 1, 2024

What should have been happening here is that spaces should have been added instead of "e". That part is now fixed.

Now, whether that is a desirable behavior for your case, I don't know.

@brettz9 brettz9 reopened this Oct 1, 2024
@brettz9 brettz9 removed the released label Oct 1, 2024
@joris-fonck-loreal
Copy link
Author

This is indeed the desired behavior. Thanks 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants