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

Prefer TypeScript compatibility #855

Merged
merged 1 commit into from Mar 28, 2022

Conversation

brettz9
Copy link
Collaborator

@brettz9 brettz9 commented Mar 25, 2022

feat: unless the user supplies their own object type preferredTypes, prefer object for plain objects and otherwise prefer Object<>; fixes #800

I'm not yet convinced we're ready for #834 , but in anticipation of a likely future change, I think we should go ahead and enforce the best compatibility with TypeScript now even for plain jsdoc users.

Now admittedly, TypeScript has an issue to change things to support equivalent behavior for either form when within JSDoc, but regardless, it seems that it is better for us to enforce operating in a manner closer to how TypeScript is to behave (that Object is discouraged in plain form and object is the more basic type allowing for Object.create(null)) and how it makes sense to behave (if one JSDoc type is allowed then Object` seems more like a generic-friendly form).

…s`, prefer `object` for plain objects and otherwise prefer `Object<>`; fixes gajus#800
@brettz9 brettz9 requested a review from golopot March 25, 2022 13:59
@brettz9 brettz9 merged commit 0f27282 into gajus:master Mar 28, 2022
@gajus
Copy link
Owner

gajus commented Mar 28, 2022

🎉 This PR is included in version 38.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Mar 28, 2022
@brettz9 brettz9 deleted the object-defaults-ts-friendly branch March 28, 2022 00:53
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull request Mar 31, 2022
This PR contains the following updates:

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

---

### Release Notes

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

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

[Compare Source](gajus/eslint-plugin-jsdoc@v38.1.2...v38.1.3)

##### Bug Fixes

-   **`check-types`, `no-undefined-types`:** safer optional chaining ([63a96ee](gajus/eslint-plugin-jsdoc@63a96ee))

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

[Compare Source](gajus/eslint-plugin-jsdoc@v38.1.1...v38.1.2)

##### Bug Fixes

-   **`check-types`:** proper use of optional chaining; fixes [#&#8203;861](gajus/eslint-plugin-jsdoc#861) ([7dbdd9f](gajus/eslint-plugin-jsdoc@7dbdd9f))

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

[Compare Source](gajus/eslint-plugin-jsdoc@v38.1.0...v38.1.1)

##### Bug Fixes

-   **`check-types`:** for `jsdoc` mode, avoid objecting to upper-case; fixes [#&#8203;860](gajus/eslint-plugin-jsdoc#860) ([d11d271](gajus/eslint-plugin-jsdoc@d11d271))

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

[Compare Source](gajus/eslint-plugin-jsdoc@v38.0.8...v38.1.0)

##### Features

-   unless the user supplies their own `object` type `preferredTypes`, prefer `object` for plain objects and otherwise prefer `Object<>`; fixes [#&#8203;800](gajus/eslint-plugin-jsdoc#800) ([#&#8203;855](gajus/eslint-plugin-jsdoc#855)) ([0f27282](gajus/eslint-plugin-jsdoc@0f27282))

</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/1262
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>
turadg added a commit to Agoric/agoric-sdk that referenced this pull request May 2, 2022
turadg added a commit to Agoric/ui-kit that referenced this pull request Jun 12, 2023
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.

In typescript mode, only allow 'object'
2 participants