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(check-tag-names): work with the constructor tag #899

Merged
merged 2 commits into from Aug 8, 2022

Conversation

tschaub
Copy link
Contributor

@tschaub tschaub commented Aug 2, 2022

This makes it so the check-tag-names rule works when JSDoc tag names match Object.prototype properties (like @constructor).

Fixes #898.

@@ -10,6 +10,12 @@ describe('jsdocUtils', () => {
it('returns the primary tag name', () => {
expect(jsdocUtils.getPreferredTagName({}, 'jsdoc', 'return')).to.equal('returns');
});
it('works with the constructor tag', () => {
expect(jsdocUtils.getPreferredTagName({}, 'jsdoc', 'constructor')).to.equal('class');
Copy link
Contributor Author

@tschaub tschaub Aug 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the src change, this test fails with expected [Function Object] to equal 'class'.

});
});
it('works with tags that clash with prototype properties', () => {
expect(jsdocUtils.getPreferredTagName({}, 'jsdoc', 'toString')).to.equal('toString');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the src change, this test fails with expected [Function toString] to equal 'toString'.

@brettz9 brettz9 merged commit 4f8d242 into gajus:master Aug 8, 2022
@gajus
Copy link
Owner

gajus commented Aug 8, 2022

🎉 This PR is included in version 39.3.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Aug 8, 2022
@tschaub tschaub deleted the tag-names branch August 8, 2022 22:12
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull request Aug 12, 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.4` -> `39.3.6`](https://renovatebot.com/diffs/npm/eslint-plugin-jsdoc/39.3.4/39.3.6) |

---

### Release Notes

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

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

[Compare Source](gajus/eslint-plugin-jsdoc@v39.3.5...v39.3.6)

##### Bug Fixes

-   ensure `TSDeclareFunction` is checked by default where function contexts are expected; closes [#&#8203;897](gajus/eslint-plugin-jsdoc#897) ([25d2a7f](gajus/eslint-plugin-jsdoc@25d2a7f))

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

[Compare Source](gajus/eslint-plugin-jsdoc@v39.3.4...v39.3.5)

##### Bug Fixes

-   **`check-tag-names`:** constructor tag and tagNamePreference ([#&#8203;899](gajus/eslint-plugin-jsdoc#899)) ([4f8d242](gajus/eslint-plugin-jsdoc@4f8d242))

</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).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNTEuMiIsInVwZGF0ZWRJblZlciI6IjMyLjE1MS4yIn0=-->

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1495
Reviewed-by: 6543 <6543@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.

Use of tagNamePreference breaks all @constructor tags
3 participants