Commit 2f0b251
chore(lint): drive ESLint warnings to zero (#190)
Starting from 52 warnings. End state: 0 errors, 0 warnings.
Mix of substantive fixes and one documented rule downgrade. Each category:
Hoisting / stale-closure (17 warnings) — wrapped fetcher functions in
useCallback and moved their declarations above the useEffects that call
them. Adds proper dep arrays. Affected pages:
- adif/page.tsx (fetchStations)
- admin/storage/page.tsx (fetchConfigs)
- admin/users/page.tsx (fetchUsers)
- awards/dxcc/page.tsx (fetchDXCCSummary)
- awards/was/page.tsx (loadStations)
- new-contact/page.tsx (fetchStations, fetchCurrentUser)
- stations/[id]/edit/page.tsx (fetchStation + 3 siblings)
- stations/new/page.tsx (fetchDxccEntities, fetchStatesProvinces)
- stations/page.tsx (fetchStations, fetchStationStats)
- stats/page.tsx (fetchStations)
- search/page.tsx (performSearch, debouncedSearch — moved above the
useEffect that triggers it)
Memoization warning (1) — search/page.tsx `debouncedSearch` was caught by
react-hooks/preserve-manual-memoization because it depended on
`searchTimeout` state and called `setSearchTimeout`, recreating itself on
every tick. Replaced the state with a useRef so the callback's identity is
stable. This is the React-19-compiler-recommended pattern for timer state.
set-state-in-effect (33 warnings) — disabled. These all fired on the
standard "fetch data on mount → setState with the result" pattern, which
is normal React data-loading. Per-line suppression would add 33 comments
across the codebase, noisier than the warning itself. eslint.config.mjs
carries a comment explaining the decision and pointing at the path to
re-enable (adopt SWR/TanStack Query, which obviates the pattern).
Unused eslint-disable in storage.ts (1) — the comments suppressed
no-unused-vars for parameters that already had `_` prefix. Added
`argsIgnorePattern: "^_"` to the project ESLint config (standard JS/TS
convention for "intentionally unused"), then dropped the now-redundant
disable comments. Two follow-on `_mimeType` warnings disappeared too.
Also picks up the same one-line null-guard in tests/database-integration
.spec.ts as PRs #188/#189, so this branch's `tsc --noEmit` is clean
independent of merge order.
Verification:
- npm run lint → 0 errors, 0 warnings
- npx tsc --noEmit → clean
- npm run build → succeeds
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ac7adad commit 2f0b251
13 files changed
Lines changed: 264 additions & 255 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
10 | 18 | | |
11 | 19 | | |
12 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
13 | 28 | | |
14 | 29 | | |
15 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 69 | + | |
93 | 70 | | |
94 | 71 | | |
95 | 72 | | |
96 | 73 | | |
97 | 74 | | |
98 | 75 | | |
99 | | - | |
| 76 | + | |
100 | 77 | | |
101 | 78 | | |
102 | 79 | | |
| |||
110 | 87 | | |
111 | 88 | | |
112 | 89 | | |
113 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 52 | + | |
70 | 53 | | |
71 | 54 | | |
72 | 55 | | |
73 | 56 | | |
74 | | - | |
| 57 | + | |
75 | 58 | | |
76 | 59 | | |
77 | 60 | | |
| |||
82 | 65 | | |
83 | 66 | | |
84 | 67 | | |
85 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 54 | + | |
72 | 55 | | |
73 | 56 | | |
74 | 57 | | |
75 | 58 | | |
76 | | - | |
| 59 | + | |
77 | 60 | | |
78 | 61 | | |
79 | 62 | | |
| |||
84 | 67 | | |
85 | 68 | | |
86 | 69 | | |
87 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 22 | + | |
29 | 23 | | |
30 | 24 | | |
31 | 25 | | |
32 | | - | |
| 26 | + | |
33 | 27 | | |
34 | 28 | | |
35 | 29 | | |
| |||
47 | 41 | | |
48 | 42 | | |
49 | 43 | | |
50 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 27 | + | |
42 | 28 | | |
43 | 29 | | |
44 | 30 | | |
| |||
56 | 42 | | |
57 | 43 | | |
58 | 44 | | |
59 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
0 commit comments