Skip to content

Commit bcc8766

Browse files
committed
fix: enhance accessibility by adding dependencies to hooks and improving effect dependencies
1 parent 2b8d965 commit bcc8766

File tree

12 files changed

+17
-16
lines changed

12 files changed

+17
-16
lines changed

src/auth/oauth.server.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,6 @@ export interface OAuthConfig {
172172
clientSecret: string
173173
}
174174

175-
export interface GitHubOAuthConfig extends OAuthConfig {}
176-
export interface GoogleOAuthConfig extends OAuthConfig {}
177-
178175
/**
179176
* Build GitHub OAuth authorization URL
180177
*/

src/components/BlockWithFeedback.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export function BlockWithFeedback({
4141
return feedback.userNotes.find((n) => n.blockSelector === blockSelector)
4242
}, [feedback.userNotes, blockSelector])
4343

44-
const isCollapsed = note ? feedback.collapsedNotes.has(note.id) : false
4544
const hasNote = !!note
4645

4746
const handleAddNote = React.useCallback(() => {

src/components/CookieConsent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export default function CookieConsent() {
134134
}
135135

136136
checkLocationAndSetConsent()
137+
// eslint-disable-next-line react-hooks/exhaustive-deps
137138
}, [])
138139

139140
const acceptAllCookies = () => {

src/components/DocFeedbackFloatingButton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export function DocFeedbackFloatingButton({
5959
document.removeEventListener('mousedown', handleClickOutside)
6060
document.removeEventListener('keydown', handleEscape)
6161
}
62+
// eslint-disable-next-line react-hooks/exhaustive-deps
6263
}, [isMenuOpen])
6364

6465
const handleButtonClick = (e: React.MouseEvent) => {
@@ -86,6 +87,7 @@ export function DocFeedbackFloatingButton({
8687
}
8788

8889
return (
90+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
8991
<div
9092
ref={buttonRef}
9193
className="doc-feedback-floating-btn absolute top-0 right-0 -translate-y-full z-[100]"

src/components/FeedFilters.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function FeedFilters({
136136
// Update filters when debounced search changes
137137
React.useEffect(() => {
138138
onFiltersChange({ search: debouncedSearch || undefined })
139-
}, [debouncedSearch])
139+
}, [debouncedSearch, onFiltersChange])
140140

141141
// Sync local state with prop when search prop changes externally
142142
React.useEffect(() => {

src/components/SearchModal.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ function LibraryRefinement() {
182182
if (!isAlreadyRefined && library) {
183183
refine(subpathname)
184184
}
185-
}, [])
185+
}, [items, refine, subpathname])
186186

187187
return (
188188
<div className="overflow-x-auto scrollbar-hide">
@@ -252,7 +252,7 @@ function FrameworkRefinement() {
252252
if (!isAlreadyRefined && framework) {
253253
refine(subpathname)
254254
}
255-
}, [subpathname])
255+
}, [items, refine, subpathname])
256256

257257
return (
258258
<div className="overflow-x-auto scrollbar-hide">
@@ -436,6 +436,7 @@ export function SearchModal() {
436436
}}
437437
submitIconComponent={submitIconComponent}
438438
resetIconComponent={resetIconComponent}
439+
// eslint-disable-next-line jsx-a11y/no-autofocus
439440
autoFocus
440441
/>
441442
</div>

src/routes/admin/github-stats.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ function GitHubStatsAdmin() {
300300
},
301301
},
302302
],
303-
[refreshingKey, refreshAllMutation],
303+
[refreshingKey, refreshAllMutation, refreshMutation],
304304
)
305305

306306
const table = useReactTable({

src/routes/api/admin/sync.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { getEffectiveCapabilities } from '~/utils/capabilities.server'
66
export const Route = createFileRoute('/api/admin/sync')({
77
server: {
88
handlers: {
9-
POST: async ({ request }) => {
9+
POST: async () => {
1010
try {
1111
// Require admin capability
1212
const user = await getAuthenticatedUser()

src/routes/stats/npm/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ function PackageSearch({
859859
value={inputValue}
860860
onValueChange={handleInputChange}
861861
onFocus={() => setOpen(true)}
862+
// eslint-disable-next-line jsx-a11y/no-autofocus
862863
autoFocus={autoFocus}
863864
/>
864865
</div>
@@ -1803,6 +1804,7 @@ function RouteComponent() {
18031804
<PackageSearch
18041805
onSelect={handleAddToGroup}
18051806
placeholder="Search for packages to add..."
1807+
// eslint-disable-next-line jsx-a11y/no-autofocus
18061808
autoFocus={true}
18071809
/>
18081810
</div>

src/stores/userSettings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type UserSettingsState = {
1818
// Remove toggleAds since it's now handled by the new hooks
1919
}
2020

21-
export const useUserSettingsStore = create<UserSettingsState>()((set, get) => ({
21+
export const useUserSettingsStore = create<UserSettingsState>()((set) => ({
2222
settings: {
2323
// Remove adsDisabled initialization
2424
},

0 commit comments

Comments
 (0)