[PR #5938] [MERGED] chore: enable useDateNow lint rule #31936

Closed
opened 2026-04-17 22:48:43 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: canaryHead: himself65/2025/11/12/lint


📝 Commits (1)

  • 328c467 chore: enable useDateNow lint rule

📊 Changes

4 files changed (+6 additions, -5 deletions)

View changed files

📝 biome.json (+1 -0)
📝 demo/nextjs/app/admin/page.tsx (+1 -1)
📝 packages/better-auth/src/plugins/api-key/api-key.test.ts (+2 -2)
📝 packages/better-auth/src/plugins/api-key/routes/verify-api-key.ts (+2 -2)

📄 Description

Summary by cubic

Enabled the useDateNow lint rule and refactored time calculations to use Date.now() instead of new Date().getTime(). This standardizes epoch time usage and slightly improves performance in the admin UI and API key logic/tests.

  • Refactors
    • Config: added "useDateNow": "error" to biome.json.
    • Admin: banExpiresIn now uses Date.now().
    • API key plugin: expiration and refill checks updated to Date.now(); tests adjusted accordingly.

Written for commit 328c467d38. 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/5938 **Author:** [@himself65](https://github.com/himself65) **Created:** 11/12/2025 **Status:** ✅ Merged **Merged:** 11/12/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/11/12/lint` --- ### 📝 Commits (1) - [`328c467`](https://github.com/better-auth/better-auth/commit/328c467d381e588315e3a6e159c626aadbdf4ef8) chore: enable `useDateNow` lint rule ### 📊 Changes **4 files changed** (+6 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `biome.json` (+1 -0) 📝 `demo/nextjs/app/admin/page.tsx` (+1 -1) 📝 `packages/better-auth/src/plugins/api-key/api-key.test.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/api-key/routes/verify-api-key.ts` (+2 -2) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Enabled the useDateNow lint rule and refactored time calculations to use Date.now() instead of new Date().getTime(). This standardizes epoch time usage and slightly improves performance in the admin UI and API key logic/tests. - **Refactors** - Config: added "useDateNow": "error" to biome.json. - Admin: banExpiresIn now uses Date.now(). - API key plugin: expiration and refill checks updated to Date.now(); tests adjusted accordingly. <sup>Written for commit 328c467d381e588315e3a6e159c626aadbdf4ef8. 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-17 22:48:43 -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#31936