Skip to content

Commit f24aa96

Browse files
committed
chore(lint): Remaining eslint refactor fixes
1 parent cf5956d commit f24aa96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+148
-134
lines changed

packages/openneuro-app/src/scripts/common/containers/__tests__/header.spec.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ vi.mock("../../../uploader/uploader-view.jsx", () => ({
1010
default: () => "mocked UploaderView",
1111
}))
1212
vi.mock("react-router-dom", async () => ({
13-
// @ts-ignore-check
1413
...(await vi.importActual("react-router-dom")),
1514
useNavigate: () => navigate,
1615
}))

packages/openneuro-app/src/scripts/common/content/terms.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React, { ReactElement } from "react"
1+
import React from "react"
22

33
/** Terms and conditions content. */
4-
export function Terms(): ReactElement {
4+
export function Terms(): React.ReactElement {
55
return (
66
<>
77
<p>

packages/openneuro-app/src/scripts/components/data-table.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import {
44
flexRender,
55
getCoreRowModel,
66
getSortedRowModel,
7-
SortingState,
87
useReactTable,
98
} from "@tanstack/react-table"
9+
import type { SortingState } from "@tanstack/react-table"
1010
import styled from "@emotion/styled"
1111
import { format, isValid, parse } from "date-fns"
1212

1313
interface DataTableProps {
14+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
1415
data: any[]
1516
downloadFilename?: string
1617
hideColumns?: string[]
@@ -55,6 +56,7 @@ export function extractDateString(dateString) {
5556
return false
5657
}
5758

59+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
5860
function CellFormat(props): any {
5961
const value = props.getValue()
6062
let extractedDate
@@ -86,6 +88,7 @@ export function DataTable<T>({
8688
Object.keys(data[0])
8789
.filter((name) => !hideColumns.includes(name))
8890
.map((name) =>
91+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
8992
columnHelper.accessor(name as any, {
9093
header: name,
9194
cell: CellFormat,

packages/openneuro-app/src/scripts/datalad/mutations/snapshot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const CreateSnapshotMutation = ({ datasetId, tag, changes }) => {
3333
interface SnapshotDatasetProps {
3434
datasetId: string
3535
tag: string
36-
changes: Array<string>
36+
changes: string[]
3737
}
3838

3939
const SnapshotDataset = ({ datasetId, tag, changes }: SnapshotDatasetProps) => (

packages/openneuro-app/src/scripts/dataset/comments/comment-editor.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const CommentEditor = ({
2020
)
2121
const doAfterSubmit = () => {
2222
setEditorState(EditorState.createEmpty())
23-
done && done()
23+
if (done) done()
2424
}
2525
const disabled = editorState.getUndoStack().size === 0
2626
return (

packages/openneuro-app/src/scripts/dataset/components/DatasetToolButton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react"
2-
import styled, { StyledComponent } from "@emotion/styled"
2+
import styled from "@emotion/styled"
3+
import type { StyledComponent } from "@emotion/styled"
34
import { Link } from "react-router-dom"
45
import { Tooltip } from "@openneuro/components/tooltip"
56
import { Icon } from "@openneuro/components/icon"

packages/openneuro-app/src/scripts/dataset/components/DatasetTools.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from "react"
22
import { DatasetToolButton } from "./DatasetToolButton"
3-
import styled, { StyledComponent } from "@emotion/styled"
3+
import styled from "@emotion/styled"
4+
import type { StyledComponent } from "@emotion/styled"
45
import { useAgreement } from "../../components/agreement"
56

6-
interface DatasetToolStyleProps {}
7-
8-
export const DatasetToolStyle: StyledComponent<DatasetToolStyleProps> = styled
7+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
8+
export const DatasetToolStyle: StyledComponent<{}> = styled
99
.span`
1010
display: flex;
1111
justify-content: flex-start;

packages/openneuro-app/src/scripts/dataset/files/file-tree.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ interface FileTreeProps {
1717
files: DatasetFile[]
1818
editMode: boolean
1919
defaultExpanded: boolean
20+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2021
datasetPermissions: any
2122
toggleFileToDelete: ({ id, path, filename }) => void
2223
isFileToBeDeleted: (id: string) => boolean

packages/openneuro-app/src/scripts/dataset/files/files.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ interface FilesProps {
3939
datasetName: string
4040
files: DatasetFile[]
4141
editMode: boolean
42+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
4243
datasetPermissions: any
44+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
4345
summary: any
4446
}
4547

packages/openneuro-app/src/scripts/dataset/files/viewers/file-viewer-nifti.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@ const FileViewerNifti = ({
1717
limitFrames4D: 5,
1818
},
1919
]
20-
const nv = new Niivue({ dragAndDropEnabled: false })
20+
const nv = new Niivue({
21+
dragAndDropEnabled: false,
22+
}) /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2123
;(window as any).niivue = nv
2224
nv.attachToCanvas(canvas.current)
2325
nv.loadVolumes(volumeList) // press the "v" key to cycle through views (axial, coronal, sagittal, 3D, etc.)
2426
nv.graph.autoSizeMultiplanar = true // use autosizing
2527
nv.opts.multiplanarForceRender = true // ensure that we draw the time series graph in the tile usually reserved for the 3D render
2628
nv.graph.normalizeValues = false // use raw data values on y-axis
2729
nv.graph.opacity = 1.0 // show the graph
28-
// Notes:
30+
// Notes:
2931
// 1. If an image only has one volume, the timeseries graph will not be visible.
30-
// The 3D render will be placed in the graph tile instead.
32+
// The 3D render will be placed in the graph tile instead.
3133
// 2. Users can navigate volumes forward and backward in the series using the left and right arrow keys on desktop devices
3234
// 3. On touch screens, users can tap on the timeseries graph to jump to a volume index
3335
// 4. Users can load all volumes by clicking on the "..." displayed on the timeseries graph

0 commit comments

Comments
 (0)