Skip to content

startLines in tag-lines is not a replacement of newline-after-description when there is no description #1022

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

Closed
stof opened this issue Apr 18, 2023 · 3 comments · Fixed by #1023

Comments

@stof
Copy link

stof commented Apr 18, 2023

Expected behavior

If there is no description, tag-lines should have a way to allow the tag to be at the beginning of the jsdoc, even though we want a line between the description and the tags when we have both. Otherwise, there is no proper replacement for jsdoc/newline-after-description with always

Actual behavior

startLines: 1 always forces an empty line even if it is the beginning of the jsdoc.

ESLint Config

{
    "plugins": ["jsdoc"],
    "rules": {
        "jsdoc/tag-lines": ["error", "never", {
            "startLines": 1
        }],
    }
}

ESLint sample

/**
 * @param {string} input
 * @param {string|rename.Options} renamingConfig
 * @returns {gulp.TaskFunction}
 */
function processSass (input, renamingConfig) {
    // <redacted>
}

Environment

  • Node version: 18.16.0
  • ESLint version: 8.38.0
  • eslint-plugin-jsdoc version: 43.0.0
@github-actions
Copy link

🎉 This issue has been resolved in version 43.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@brettz9
Copy link
Collaborator

brettz9 commented Apr 18, 2023

Sorry about that, and thanks for the report. startLines was indeed intended to only apply after any text (as with newline-after-description), so #1023 will hopefully address that.

@stof
Copy link
Author

stof commented Apr 18, 2023

@brettz9 it indeed addresses most of the errors reported on my project when upgrading. I opened #1024 for the opposite case which also breaks.

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

Successfully merging a pull request may close this issue.

2 participants