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

check-line-alignment with option postHyphen adds white space at end of line #983

Closed
thernstig opened this issue Feb 8, 2023 · 1 comment · Fixed by #986
Closed

check-line-alignment with option postHyphen adds white space at end of line #983

thernstig opened this issue Feb 8, 2023 · 1 comment · Fixed by #986

Comments

@thernstig
Copy link

Expected behavior

I would expect the rule check-line-alignment with option postHyphens to not add white space at end of line, if there only is an end of line character at the end of the string after the hyphen.

Actual behavior

ESLint sample below shows it best.

ESLint Config

{
  "root": true,
  "reportUnusedDisableDirectives": true,
  "parserOptions": {
    "ecmaVersion": 2023,
    "sourceType": "module"
  },
  "env": {
    "node": true,
    "es2022": true
  },
  "extends": ["plugin:jsdoc/recommended"],
  "plugins": ["unicorn"],
  "rules": {
    "jsdoc/require-jsdoc": "off",
    "jsdoc/require-description": "warn",
    "jsdoc/check-syntax": "warn",
    "jsdoc/check-line-alignment": ["warn", "never"],
    "jsdoc/require-hyphen-before-param-description": [
      "warn",
      "always",
      { "tags": { "property": "always" } }
    ],
    "jsdoc/require-asterisk-prefix": "warn",
    "jsdoc/tag-lines": "off", // TODO: Temporary, will be fixed soon
    "jsdoc/no-bad-blocks": ["warn", { "preventAllMultiAsteriskBlocks": true }]
  },
  "settings": {
    "jsdoc": {
      "mode": "typescript"
    }
  }
}

ESLint sample

Before linting

   * @param {string|string[]|TemplateResult|TemplateResult[]} event.detail.description -
   *    Notification description

After linting with --fix

Notice the white space directly after the -.

   * @param {string|string[]|TemplateResult|TemplateResult[]} event.detail.description - 
   *    Notification description

Environment

  • Node version: v18.12.1
  • ESLint version v8.31.0
  • eslint-plugin-jsdoc version: 39.8.0
@github-actions
Copy link

🎉 This issue has been resolved in version 39.9.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@thernstig thernstig changed the title check-line-alignment with option postHyphens adds white space at end of line check-line-alignment with option postHyphen adds white space at end of line Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants