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 "always" option breaks if there is no @param or @return type #891

Closed
TGCrystal opened this issue Jun 18, 2022 · 1 comment

Comments

@TGCrystal
Copy link
Contributor

The check-line-alignment rule, with the always option, gives an error when there is only one space between the @param tag and the parameter name if there is no type definition in between. The same issue occurs with the @return tag in this context. The error goes away if there are instead 2 spaces between the tag and the next word.
I noticed issue #714 is similar, but that applies to the never option and only the @param tag.

Expected behavior

No errors are given.
The two spaces seems to be there for the type definition to go between, but in a Typescript project the jsdoc type definitions are redundant and unnecessary.

Actual behavior

The following error is given for either test case below:

Expected JSDoc block lines to be aligned  jsdoc/check-line-alignment

ESLint Config

{
    "plugins": [
        "jsdoc"
    ],
    "rules": {
        "jsdoc/check-line-alignment": [
            2,
            "always"
        ]
    }
}

ESLint sample

/**
 * Function description.
 *
 * @param lorem Description.
 * @param sit   Description multi words.
 */
const fn = ( lorem, sit ) => {}
/**
 * Function description.
 *
 * @return Return description.
 */
const fn = () => {}

Environment

  • Node version: 16.13.2
  • ESLint version 8.17.0
  • eslint-plugin-jsdoc version: 39.3.2
@gajus
Copy link
Owner

gajus commented Jun 18, 2022

🎉 This issue has been resolved in version 39.3.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Jun 18, 2022
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this issue Jun 22, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) | devDependencies | patch | [`39.3.2` -> `39.3.3`](https://renovatebot.com/diffs/npm/eslint-plugin-jsdoc/39.3.2/39.3.3) |

---

### Release Notes

<details>
<summary>gajus/eslint-plugin-jsdoc</summary>

### [`v39.3.3`](https://github.com/gajus/eslint-plugin-jsdoc/releases/tag/v39.3.3)

[Compare Source](gajus/eslint-plugin-jsdoc@v39.3.2...v39.3.3)

##### Bug Fixes

-   **`check-line-alignment`:** if no types are present, avoid allocating extra space; fixes [#&#8203;891](gajus/eslint-plugin-jsdoc#891) ([26e7357](gajus/eslint-plugin-jsdoc@26e7357))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).

Co-authored-by: cabr2-bot <[email protected]>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1428
Reviewed-by: 6543 <[email protected]>
Co-authored-by: Calciumdibromid Bot <[email protected]>
Co-committed-by: Calciumdibromid Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants