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

fix(require-param-type): report column=1 #875

Merged
merged 2 commits into from Apr 18, 2022
Merged

Conversation

chearon
Copy link
Contributor

@chearon chearon commented Apr 18, 2022

Hello, I've been dealing with an annoying bug using NeoVim + LSP + eslint. If I'm typing a function parameter from scratch, like /** @param {nu, this plugin rightfully reports an error (require-param-type) since I haven't finished typing the type.

But it reports column number = 0 which causes NeoVim's LSP client to crash, interrupting my typing.

Presumably it would be impossible to error on an empty line, so I'm hoping adding column = 1 when the upstream parser doesn't report a column number is okay as a quick fix. I'm sure there is a better way to get the real column number but I don't have time to dig any deeper right now.

Not sure if other rules are affected or not, this is the only one I ran into.

Thanks!


x.js

/**
 * @param {a xxx
 */

yarn eslint x.js before commit

2:0   error  Missing JSDoc @param "" type     jsdoc/require-param-type

yarn eslint x.js after commit

2:1   error  Missing JSDoc @param "" type     jsdoc/require-param-type

chearon and others added 2 commits April 18, 2022 13:21
Source
```js
/**
 * @param {a xxx
 * @param {bc
 */
```

Before
```
  2:0   error  Missing JSDoc @param "" type     jsdoc/require-param-type
  3:0   error  Missing JSDoc @param "" type     jsdoc/require-param-type
```

After
```
  2:1   error  Missing JSDoc @param "" type     jsdoc/require-param-type
  3:1   error  Missing JSDoc @param "" type     jsdoc/require-param-type
```
Also:
- test: adds test for `require-param-type`
@brettz9 brettz9 merged commit 2f104f8 into gajus:master Apr 18, 2022
@gajus
Copy link
Owner

gajus commented Apr 18, 2022

🎉 This PR is included in version 39.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Apr 18, 2022
@brettz9
Copy link
Collaborator

brettz9 commented Apr 18, 2022

LGTM--thanks for the report!

crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull request Apr 25, 2022
This PR contains the following updates:

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

---

### Release Notes

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

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

[Compare Source](gajus/eslint-plugin-jsdoc@v39.2.3...v39.2.4)

##### Bug Fixes

-   **`require-jsdoc`:** proper reporting of end line numbers; fixes [#&#8203;843](gajus/eslint-plugin-jsdoc#843) ([4270b75](gajus/eslint-plugin-jsdoc@4270b75))

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

[Compare Source](gajus/eslint-plugin-jsdoc@v39.2.2...v39.2.3)

##### Bug Fixes

-   **`require-param-type`:** report column=1 ([#&#8203;875](gajus/eslint-plugin-jsdoc#875)) ([2f104f8](gajus/eslint-plugin-jsdoc@2f104f8))

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

[Compare Source](gajus/eslint-plugin-jsdoc@v39.2.1...v39.2.2)

##### Bug Fixes

-   **`comment`:** updates `jsdoccomment` ([0eef81c](gajus/eslint-plugin-jsdoc@0eef81c))

</details>

---

### Configuration

📅 **Schedule**: 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 <cabr2.help@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1311
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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants