Skip to content

Commit ae223fd

Browse files
committed
chore: Linting fixes
1 parent 21d3a1d commit ae223fd

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

packages/openneuro-app/src/scripts/contributors/__tests__/contributor-list.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react"
2-
import { fireEvent, render, screen, waitFor } from "@testing-library/react"
2+
import { fireEvent, render, screen } from "@testing-library/react"
33
import { MockedProvider } from "@apollo/client/testing"
44
import { ContributorsListDisplay } from "../contributors-list"
55
import type { Contributor } from "../../types/datacite"

packages/openneuro-app/src/scripts/dataset/__tests__/__snapshots__/snapshot-container.spec.tsx.snap

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -775,16 +775,6 @@ OCI-1131441 (R. Poldrack, PI) in any publications.
775775
</h2>
776776
ds001032
777777
</div>
778-
<div
779-
class="dataset-meta-block "
780-
>
781-
<h2
782-
class="dmb-heading"
783-
>
784-
Creators
785-
</h2>
786-
N/A
787-
</div>
788778
<div
789779
class="dataset-meta-block dmb-inline-list"
790780
>

packages/openneuro-app/src/scripts/users/user-notification-accordion.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const NotificationAccordion = ({
5858
const [currentApprovalAction, setCurrentApprovalAction] = useState<
5959
"accepted" | "denied" | null
6060
>(null)
61+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6162
const [localError, setLocalError] = useState<string | null>(null)
6263
const [processContributorRequest, { loading: processRequestLoading }] =
6364
useMutation(PROCESS_CONTRIBUTOR_REQUEST_MUTATION)
@@ -126,10 +127,12 @@ export const NotificationAccordion = ({
126127
setShowReasonInput(false)
127128
setReasonInput("")
128129
setCurrentApprovalAction(null)
129-
} catch (error: any) {
130-
const errorMessage = `Error processing contributor request: ${
131-
error.message || "Unknown error"
132-
}`
130+
} catch (error: unknown) {
131+
let message = "Unknown error"
132+
if (error instanceof Error) {
133+
message = error.message
134+
}
135+
const errorMessage = `Error processing contributor request: ${message}`
133136
Sentry.captureException(error)
134137
toast.error(
135138
<ToastContent title="Processing Failed" body={errorMessage} />,

packages/openneuro-app/src/scripts/users/user-notifications-context.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { createContext, useCallback, useContext, useState } from "react"
22
import { useMutation } from "@apollo/client"
33
import { UPDATE_NOTIFICATION_STATUS_MUTATION } from "../queries/datasetEvents"
44
import type { MappedNotification } from "../types/event-types"
5+
import * as Sentry from "@sentry/react"
56

67
interface NotificationsContextValue {
78
notifications: MappedNotification[]
@@ -44,7 +45,7 @@ export const NotificationsProvider: React.FC<NotificationsProviderProps> = ({
4445
variables: { eventId: id, status: updates.status.toUpperCase() },
4546
})
4647
} catch (err) {
47-
console.error("Failed to update notification status:", err)
48+
Sentry.captureException(err)
4849
}
4950
}
5051
},

0 commit comments

Comments
 (0)