[PR #7369] [MERGED] chore: add lint rule useConst #24166

Closed
opened 2026-04-15 22:12:40 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7369
Author: @himself65
Created: 1/14/2026
Status: Merged
Merged: 1/14/2026
Merged by: @himself65

Base: canaryHead: himself65/2026/01/14/use-const


📝 Commits (1)

  • d02deae chore: add lint rule useConst

📊 Changes

96 files changed (+254 additions, -260 deletions)

View changed files

📝 biome.json (+1 -0)
📝 demo/oidc-client/src/lib/auth/useAuth.ts (+4 -9)
📝 docs/app/blog/_components/_layout.tsx (+2 -2)
📝 docs/app/blog/_components/default-changelog.tsx (+1 -1)
📝 docs/app/blog/_components/stat-field.tsx (+11 -11)
📝 docs/app/changelogs/_components/_layout.tsx (+2 -2)
📝 docs/app/changelogs/_components/changelog-layout.tsx (+1 -1)
📝 docs/app/changelogs/_components/default-changelog.tsx (+1 -1)
📝 docs/app/changelogs/_components/stat-field.tsx (+11 -11)
📝 docs/components/api-method.tsx (+6 -6)
📝 docs/components/ui/background-boxes.tsx (+1 -1)
📝 docs/lib/blog.ts (+1 -1)
📝 docs/lib/llm-text.ts (+1 -1)
📝 docs/lib/utils.ts (+1 -1)
📝 docs/scripts/endpoint-to-doc/index.ts (+9 -9)
📝 packages/better-auth/src/adapters/create-test-suite.ts (+3 -3)
📝 packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts (+6 -6)
📝 packages/better-auth/src/adapters/drizzle-adapter/test/generate-schema.ts (+3 -3)
📝 packages/better-auth/src/adapters/kysely-adapter/dialect.ts (+1 -1)
📝 packages/better-auth/src/adapters/kysely-adapter/kysely-adapter.ts (+4 -4)

...and 76 more files

📄 Description

Summary by cubic

Added the Biome lint rule “useConst” and refactored the codebase to prefer const for variables that aren’t reassigned. This enforces immutability and consistent style, with no runtime behavior changes.

  • Refactors
    • Enabled useConst as an error in biome.json.
    • Replaced let with const across core, adapters, clients, plugins, tests, docs, and CLI wherever variables aren’t reassigned.

Written for commit d02deaeb44. Summary will update 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/7369 **Author:** [@himself65](https://github.com/himself65) **Created:** 1/14/2026 **Status:** ✅ Merged **Merged:** 1/14/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2026/01/14/use-const` --- ### 📝 Commits (1) - [`d02deae`](https://github.com/better-auth/better-auth/commit/d02deaeb4460bd1352ff02b230050f0e75495e10) chore: add lint rule `useConst` ### 📊 Changes **96 files changed** (+254 additions, -260 deletions) <details> <summary>View changed files</summary> 📝 `biome.json` (+1 -0) 📝 `demo/oidc-client/src/lib/auth/useAuth.ts` (+4 -9) 📝 `docs/app/blog/_components/_layout.tsx` (+2 -2) 📝 `docs/app/blog/_components/default-changelog.tsx` (+1 -1) 📝 `docs/app/blog/_components/stat-field.tsx` (+11 -11) 📝 `docs/app/changelogs/_components/_layout.tsx` (+2 -2) 📝 `docs/app/changelogs/_components/changelog-layout.tsx` (+1 -1) 📝 `docs/app/changelogs/_components/default-changelog.tsx` (+1 -1) 📝 `docs/app/changelogs/_components/stat-field.tsx` (+11 -11) 📝 `docs/components/api-method.tsx` (+6 -6) 📝 `docs/components/ui/background-boxes.tsx` (+1 -1) 📝 `docs/lib/blog.ts` (+1 -1) 📝 `docs/lib/llm-text.ts` (+1 -1) 📝 `docs/lib/utils.ts` (+1 -1) 📝 `docs/scripts/endpoint-to-doc/index.ts` (+9 -9) 📝 `packages/better-auth/src/adapters/create-test-suite.ts` (+3 -3) 📝 `packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts` (+6 -6) 📝 `packages/better-auth/src/adapters/drizzle-adapter/test/generate-schema.ts` (+3 -3) 📝 `packages/better-auth/src/adapters/kysely-adapter/dialect.ts` (+1 -1) 📝 `packages/better-auth/src/adapters/kysely-adapter/kysely-adapter.ts` (+4 -4) _...and 76 more files_ </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Added the Biome lint rule “useConst” and refactored the codebase to prefer const for variables that aren’t reassigned. This enforces immutability and consistent style, with no runtime behavior changes. - **Refactors** - Enabled useConst as an error in biome.json. - Replaced let with const across core, adapters, clients, plugins, tests, docs, and CLI wherever variables aren’t reassigned. <sup>Written for commit d02deaeb4460bd1352ff02b230050f0e75495e10. Summary will update 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-15 22:12:40 -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#24166