[PR #6689] [MERGED] chore: fix type inference for future TS compatibility #15075

Closed
opened 2026-04-13 09:48:50 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6689
Author: @himself65
Created: 12/11/2025
Status: Merged
Merged: 12/11/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/12/11/no-infer


📝 Commits (1)

  • d0aa895 chore: fix type inference for future TS compatibility

📊 Changes

4 files changed (+7 additions, -7 deletions)

View changed files

📝 packages/better-auth/src/plugins/admin/admin.ts (+1 -1)
📝 packages/better-auth/src/plugins/jwt/index.ts (+2 -2)
📝 packages/better-auth/src/plugins/oauth-proxy/index.ts (+2 -2)
📝 packages/better-auth/src/plugins/two-factor/index.ts (+2 -2)

📄 Description

Similar to #6643

Summary by cubic

Improved TypeScript type inference for plugin options using NoInfer to prevent unintended widening and ensure future TS compatibility. No runtime behavior changes.

  • Refactors
    • Updated admin, jwt, oauth-proxy, and two-factor plugins to use generic O extends Options and cast options as NoInfer.
    • Preserves exact option types in returned plugin objects for safer inference across TS versions.
    • API surface unchanged; type-only adjustments.

Written for commit d0aa895fe1. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6689 **Author:** [@himself65](https://github.com/himself65) **Created:** 12/11/2025 **Status:** ✅ Merged **Merged:** 12/11/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/12/11/no-infer` --- ### 📝 Commits (1) - [`d0aa895`](https://github.com/better-auth/better-auth/commit/d0aa895fe19278841480afeca97a716cb78932dc) chore: fix type inference for future TS compatibility ### 📊 Changes **4 files changed** (+7 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/admin/admin.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/jwt/index.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/oauth-proxy/index.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/two-factor/index.ts` (+2 -2) </details> ### 📄 Description Similar to #6643 <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Improved TypeScript type inference for plugin options using NoInfer to prevent unintended widening and ensure future TS compatibility. No runtime behavior changes. - **Refactors** - Updated admin, jwt, oauth-proxy, and two-factor plugins to use generic O extends Options and cast options as NoInfer<O>. - Preserves exact option types in returned plugin objects for safer inference across TS versions. - API surface unchanged; type-only adjustments. <sup>Written for commit d0aa895fe19278841480afeca97a716cb78932dc. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 09:48:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#15075