Skip to content

Commit b7745f6

Browse files
committed
Merge: eslint cleanup (remove all disables)
2 parents 38963ab + f6090ce commit b7745f6

15 files changed

Lines changed: 98 additions & 93 deletions

FOLLOWUPS.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,12 @@ Cronicle's foundation (Node runtime, bespoke flat-file storage) is weaker than a
324324
action (§3); a richer retry editor (form sends no retry override yet).
325325
- `[DONE]` Same-name job warning on create/edit (JobForm warns inline and confirms before
326326
saving a duplicate name).
327-
- `[PLANNED]` Lint cleanup (e.g. the `react-refresh/only-export-components` disables).
327+
- `[DONE]` Lint cleanup: removed all `eslint-disable` comments. `router` (was a dead
328+
`AppRouter` + a flagged const) is now just the exported router; `useAuth`/the auth context
329+
moved to `auth/useAuth.ts` so `AuthContext.tsx` exports only the provider; `WorkersPage`
330+
uses a ticking `now` state instead of `Date.now()` in render. `eslint .` is clean.
331+
- `[PLANNED]` UI polish pass: restyle pages toward samples/descriptions the user will
332+
provide (look/feel, layout, components). Awaiting those references before starting.
328333

329334
## 10. CI / Docker follow-ups
330335

ui_dist/assets/index-CSZCiq63.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 46 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui_dist/assets/index-CuzEjnUA.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui_dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Nexus Arbiter</title>
8-
<script type="module" crossorigin src="/assets/index-CSZCiq63.js"></script>
8+
<script type="module" crossorigin src="/assets/index-CuzEjnUA.js"></script>
99
<link rel="stylesheet" crossorigin href="/assets/index-BZkqKtOk.css">
1010
</head>
1111
<body>

web-ui/src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { RouterProvider } from '@tanstack/react-router'
22
import { router } from './router'
3-
import { AuthProvider, useAuth } from './auth/AuthContext.tsx'
3+
import { AuthProvider } from './auth/AuthContext'
4+
import { useAuth } from './auth/useAuth'
45

56
function InnerApp() {
67
const auth = useAuth()

web-ui/src/auth/AuthContext.tsx

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
1-
import { createContext, useContext, useEffect, useState } from 'react'
2-
import type { User } from '../backend-types'
1+
import { useEffect, useState } from 'react'
32
import {
43
me as fetchMe,
54
login as apiLogin,
65
logout as apiLogout,
76
} from '../api/auth'
87
import { redirect } from '@tanstack/react-router'
9-
10-
export type AuthState =
11-
| { status: 'loading'; user: null }
12-
| { status: 'unauthenticated'; user: null }
13-
| { status: 'authenticated'; user: User }
14-
15-
export type AuthContextValue = {
16-
state: AuthState
17-
login: (username: string, password: string) => Promise<void>
18-
logout: () => Promise<void>
19-
}
20-
21-
const AuthContext = createContext<AuthContextValue | undefined>(undefined)
8+
import { AuthContext, type AuthState } from './useAuth'
229

2310
export function AuthProvider({ children }: { children: React.ReactNode }) {
2411
const [state, setState] = useState<AuthState>({
@@ -50,11 +37,3 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
5037
</AuthContext.Provider>
5138
)
5239
}
53-
54-
// TODO: ?
55-
// eslint-disable-next-line react-refresh/only-export-components
56-
export function useAuth() {
57-
const ctx = useContext(AuthContext)
58-
if (!ctx) throw new Error('useAuth must be used inside AuthProvider')
59-
return ctx
60-
}

web-ui/src/auth/useAuth.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { createContext, useContext } from 'react'
2+
import type { User } from '../backend-types'
3+
4+
export type AuthState =
5+
| { status: 'loading'; user: null }
6+
| { status: 'unauthenticated'; user: null }
7+
| { status: 'authenticated'; user: User }
8+
9+
export type AuthContextValue = {
10+
state: AuthState
11+
login: (username: string, password: string) => Promise<void>
12+
logout: () => Promise<void>
13+
}
14+
15+
export const AuthContext = createContext<AuthContextValue | undefined>(undefined)
16+
17+
export function useAuth() {
18+
const ctx = useContext(AuthContext)
19+
if (!ctx) throw new Error('useAuth must be used inside AuthProvider')
20+
return ctx
21+
}

web-ui/src/layout/AppLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Link } from '@tanstack/react-router'
2-
import { useAuth } from '../auth/AuthContext'
2+
import { useAuth } from '../auth/useAuth'
33
import DarkmodeToggle from '../components/DarkmodeToggle'
44
import { useEffect, useState } from 'react'
55
import { ConfigProvider, theme as antdTheme } from 'antd'

web-ui/src/pages/LoginPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type FormEvent, useEffect, useState } from 'react'
2-
import { useAuth } from '../auth/AuthContext'
2+
import { useAuth } from '../auth/useAuth'
33
import { useNavigate, useRouter } from '@tanstack/react-router'
44
import type { ApiResponse } from '../backend-types'
55

0 commit comments

Comments
 (0)