[PR #5236] [MERGED] fix: type compatibility with exactOptionalPropertyTypes #22773

Closed
opened 2026-04-15 21:16:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5236
Author: @Kinfe123
Created: 10/11/2025
Status: Merged
Merged: 10/13/2025
Merged by: @himself65

Base: canaryHead: fix/exact-optional-property-types-hooks


📝 Commits (4)

  • 5425968 fix: plugin hooks compatibility with exactOptionalPropertyTypes
  • 5b8e6a9 chore: fix tsconfig.json
  • a05bfcd chore: endpoint
  • 33377cd fix: lock

📊 Changes

15 files changed (+175 additions, -109 deletions)

View changed files

e2e/smoke/test/fixtures/tsconfig-exact-optional-property-types/package.json (+12 -0)
e2e/smoke/test/fixtures/tsconfig-exact-optional-property-types/src/index.ts (+28 -0)
e2e/smoke/test/fixtures/tsconfig-exact-optional-property-types/tsconfig.json (+14 -0)
📝 packages/better-auth/src/api/to-auth-endpoints.ts (+1 -2)
📝 packages/better-auth/src/client/lynx/index.ts (+17 -14)
📝 packages/better-auth/src/client/react/index.ts (+17 -14)
📝 packages/better-auth/src/client/solid/index.ts (+17 -14)
📝 packages/better-auth/src/client/svelte/index.ts (+17 -14)
📝 packages/better-auth/src/client/vanilla.ts (+17 -14)
📝 packages/better-auth/src/client/vue/index.ts (+19 -16)
packages/better-auth/src/types/context.ts (+0 -11)
📝 packages/better-auth/src/types/index.ts (+0 -1)
📝 packages/core/src/types/index.ts (+1 -1)
📝 packages/core/src/types/plugin.ts (+2 -2)
📝 pnpm-lock.yaml (+13 -6)

📄 Description

closes #2471
this will also works for strict types that extends the configs like "extends": "@tsconfig/strictest/tsconfig.json"
before
Screenshot 2025-10-11 at 6 27 00 PM
after
Screenshot 2025-10-11 at 6 29 09 PM


🔄 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/5236 **Author:** [@Kinfe123](https://github.com/Kinfe123) **Created:** 10/11/2025 **Status:** ✅ Merged **Merged:** 10/13/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/exact-optional-property-types-hooks` --- ### 📝 Commits (4) - [`5425968`](https://github.com/better-auth/better-auth/commit/5425968062655dfa22d955037eed121261988e58) fix: plugin hooks compatibility with exactOptionalPropertyTypes - [`5b8e6a9`](https://github.com/better-auth/better-auth/commit/5b8e6a935fcde7451a96e8321a639add3495f85b) chore: fix tsconfig.json - [`a05bfcd`](https://github.com/better-auth/better-auth/commit/a05bfcd56f4d5133ef16509456c7ffcc2dcfeb4c) chore: endpoint - [`33377cd`](https://github.com/better-auth/better-auth/commit/33377cd51a28ccead568841f9069d4e38de1225a) fix: lock ### 📊 Changes **15 files changed** (+175 additions, -109 deletions) <details> <summary>View changed files</summary> ➕ `e2e/smoke/test/fixtures/tsconfig-exact-optional-property-types/package.json` (+12 -0) ➕ `e2e/smoke/test/fixtures/tsconfig-exact-optional-property-types/src/index.ts` (+28 -0) ➕ `e2e/smoke/test/fixtures/tsconfig-exact-optional-property-types/tsconfig.json` (+14 -0) 📝 `packages/better-auth/src/api/to-auth-endpoints.ts` (+1 -2) 📝 `packages/better-auth/src/client/lynx/index.ts` (+17 -14) 📝 `packages/better-auth/src/client/react/index.ts` (+17 -14) 📝 `packages/better-auth/src/client/solid/index.ts` (+17 -14) 📝 `packages/better-auth/src/client/svelte/index.ts` (+17 -14) 📝 `packages/better-auth/src/client/vanilla.ts` (+17 -14) 📝 `packages/better-auth/src/client/vue/index.ts` (+19 -16) ➖ `packages/better-auth/src/types/context.ts` (+0 -11) 📝 `packages/better-auth/src/types/index.ts` (+0 -1) 📝 `packages/core/src/types/index.ts` (+1 -1) 📝 `packages/core/src/types/plugin.ts` (+2 -2) 📝 `pnpm-lock.yaml` (+13 -6) </details> ### 📄 Description closes #2471 this will also works for strict types that extends the configs like ` "extends": "@tsconfig/strictest/tsconfig.json"` before <img width="522" height="122" alt="Screenshot 2025-10-11 at 6 27 00 PM" src="https://github.com/user-attachments/assets/9aca7f0d-9d1f-4f7d-89e7-09c5603f8c37" /> after <img width="464" height="117" alt="Screenshot 2025-10-11 at 6 29 09 PM" src="https://github.com/user-attachments/assets/bb207fda-7d32-4f6f-abcb-e496d6cc9465" /> --- <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-15 21:16:17 -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#22773