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

Autofix breaks comments removing zero/final line #1040

Closed
Dimava opened this issue Apr 21, 2023 · 3 comments · Fixed by #1041
Closed

Autofix breaks comments removing zero/final line #1040

Dimava opened this issue Apr 21, 2023 · 3 comments · Fixed by #1041

Comments

@Dimava
Copy link

Dimava commented Apr 21, 2023

Expected behavior

When removing first or last line of the comment by autofixing, the /* / */ should remain

Actual behavior

Opening and closing of the comment can be removed by autofixer

ESLint Config

{
    plugins: ['jsdoc'],
    extends: ['plugin:jsdoc/recommended-typescript'],
    rules: {
      'jsdoc/multiline-blocks': ['warn', {
        noZeroLineText: false,
        noFinalLineText: false,
      }],
}

ESLint sample

The @typedef and @module lines get removed with comment open/close, completely breaking the code

/** @typedef {Object} MyObject
 * @property {string} id - my id
 */

/** some text
  @module */
function f() { }

Environment

  • Node version: v18.12.1
  • ESLint version 8.36.0
  • eslint-plugin-jsdoc version: 43.0.7
@brettz9
Copy link
Collaborator

brettz9 commented Apr 21, 2023

If you run eslint at the command line, which rule is reported as the cause of the error?

@brettz9
Copy link
Collaborator

brettz9 commented Apr 21, 2023

Nevermind, looks like it's check-types or check-tag-names

brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Apr 21, 2023
…ut the tag; otherwise, remove to end of block); fixes gajus#1040
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Apr 24, 2023
…ut the tag; otherwise, remove to end of block); fixes gajus#1040
brettz9 added a commit that referenced this issue Apr 24, 2023
…ut the tag; otherwise, remove to end of block); fixes #1040
@github-actions
Copy link

🎉 This issue has been resolved in version 43.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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