fix: resolve remaining TypeScript and linting errors

- Fixed unused variables in unit tests (elo.test.ts, permissions.test.ts)
- Fixed unused variables in E2E tests (account-acceptance.test.ts, elo-ratings.test.ts, epic1-auth-registration.test.ts, global.setup.ts)
- Fixed 'any' type usage in EditTournamentForm.test.tsx and auth-simple.test.ts
- Fixed unescaped quotes and apostrophes in React components
- Fixed TypeScript type errors in Navigation.tsx, test-api/page.tsx, and matches/upload/page.tsx
- Fixed missing useEffect dependency in tournaments/[id]/entry/page.tsx
- Updated eslint config to exclude test-api directory
- All tests now pass linting and build successfully
This commit is contained in:
2026-03-29 21:20:20 -07:00
parent bc99dee421
commit 576dfda619
14 changed files with 60 additions and 50 deletions
+5 -3
View File
@@ -11,8 +11,9 @@ export default function Navigation() {
useEffect(() => {
// Fetch user role from database if session exists
if (session?.user?.id) {
fetch(`/api/users/${session.user.id}/role`)
const userId = (session?.user as { id?: string })?.id
if (userId) {
fetch(`/api/users/${userId}/role`)
.then(res => res.json())
.then(data => setUserRole(data.role))
.catch(() => setUserRole(null));
@@ -65,7 +66,8 @@ export default function Navigation() {
) : session ? (
<div className="flex items-center space-x-4">
<span className="text-gray-700 text-sm font-medium">
{session.user?.name || session.user?.email}
{(session.user as { name?: string; email?: string })?.name ||
(session.user as { name?: string; email?: string })?.email}
</span>
<button
onClick={handleLogout}