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

require-returns-check: False positive for function returning function #934

Closed
iliubinskii opened this issue Nov 24, 2022 · 2 comments
Closed

Comments

@iliubinskii
Copy link

Expected behavior

Should pass without errors

Actual behavior

Getting error:

JSDoc @returns declaration present but return expression not available

ESLint Config

rules: { "jsdoc/require-returns-check": "warn" }

ESLint sample

export const f =
  /**
   * Description.
   *
   * @returns Result.
   */
  () => {
    return () => {};
  };

Environment

  • Node version: 18.12.1
  • ESLint version 8.28.0
  • eslint-plugin-jsdoc version: 39.6.2
@brettz9
Copy link
Collaborator

brettz9 commented Nov 24, 2022

The top comment block was mistakenly being found by the inner function as though that were its return statement. Surprising this hadn't been caught before. Thanks for the report!

@gajus
Copy link
Owner

gajus commented Nov 24, 2022

🎉 This issue has been resolved in version 39.6.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

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

---

### Release Notes

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

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

[Compare Source](gajus/eslint-plugin-jsdoc@v39.6.3...v39.6.4)

##### Bug Fixes

-   **`require-return-checks`:** check return statements prior to last line; fixes [#&#8203;935](gajus/eslint-plugin-jsdoc#935) ([65e927b](gajus/eslint-plugin-jsdoc@65e927b))

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

[Compare Source](gajus/eslint-plugin-jsdoc@v39.6.2...v39.6.3)

##### Bug Fixes

-   update jsdoccomment; fixes [#&#8203;934](gajus/eslint-plugin-jsdoc#934) ([124d327](gajus/eslint-plugin-jsdoc@124d327))

</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, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC40MC4wIiwidXBkYXRlZEluVmVyIjoiMzQuNDAuMCJ9-->

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1658
Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org>
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
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