Skip to content

Commit a0a5953

Browse files
authored
chore(dashboard): fix type and lint errors (1/n) (#15209)
1 parent 5553d2c commit a0a5953

45 files changed

Lines changed: 300 additions & 264 deletions

File tree

Some content is hidden

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

packages/admin/dashboard/src/components/common/file-preview/file-preview.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const FilePreview = ({
2626
<Text
2727
size="small"
2828
leading="compact"
29-
className="truncate max-w-[260px]"
29+
className="max-w-[260px] truncate"
3030
>
3131
{filename}
3232
</Text>
@@ -70,14 +70,14 @@ const FileThumbnail = () => {
7070
d="M20 31.75H4C1.92893 31.75 0.25 30.0711 0.25 28V4C0.25 1.92893 1.92893 0.25 4 0.25H15.9431C16.9377 0.25 17.8915 0.645088 18.5948 1.34835L22.6516 5.4052C23.3549 6.10847 23.75 7.06229 23.75 8.05685V28C23.75 30.0711 22.0711 31.75 20 31.75Z"
7171
fill="url(#paint0_linear_6594_388107)"
7272
stroke="url(#paint1_linear_6594_388107)"
73-
stroke-width="0.5"
73+
strokeWidth="0.5"
7474
/>
7575
<path
7676
opacity="0.4"
7777
d="M17.7857 12.8125V13.5357H10.3393V10.9643H15.9375C16.9569 10.9643 17.7857 11.7931 17.7857 12.8125ZM6.21429 16.9107V15.0893H8.78571V16.9107H6.21429ZM10.3393 16.9107V15.0893H17.7857V16.9107H10.3393ZM15.9375 21.0357H10.3393V18.4643H17.7857V19.1875C17.7857 20.2069 16.9569 21.0357 15.9375 21.0357ZM6.21429 19.1875V18.4643H8.78571V21.0357H8.0625C7.0431 21.0357 6.21429 20.2069 6.21429 19.1875ZM8.0625 10.9643H8.78571V13.5357H6.21429V12.8125C6.21429 11.7931 7.0431 10.9643 8.0625 10.9643Z"
7878
fill="url(#paint2_linear_6594_388107)"
7979
stroke="url(#paint3_linear_6594_388107)"
80-
stroke-width="0.428571"
80+
strokeWidth="0.428571"
8181
/>
8282
<defs>
8383
<linearGradient
@@ -88,8 +88,8 @@ const FileThumbnail = () => {
8888
y2="32"
8989
gradientUnits="userSpaceOnUse"
9090
>
91-
<stop stop-color="#F4F4F5" />
92-
<stop offset="1" stop-color="#E4E4E7" />
91+
<stop stopColor="#F4F4F5" />
92+
<stop offset="1" stopColor="#E4E4E7" />
9393
</linearGradient>
9494
<linearGradient
9595
id="paint1_linear_6594_388107"
@@ -99,8 +99,8 @@ const FileThumbnail = () => {
9999
y2="32"
100100
gradientUnits="userSpaceOnUse"
101101
>
102-
<stop stop-color="#E4E4E7" />
103-
<stop offset="1" stop-color="#D4D4D8" />
102+
<stop stopColor="#E4E4E7" />
103+
<stop offset="1" stopColor="#D4D4D8" />
104104
</linearGradient>
105105
<linearGradient
106106
id="paint2_linear_6594_388107"
@@ -110,8 +110,8 @@ const FileThumbnail = () => {
110110
y2="21.25"
111111
gradientUnits="userSpaceOnUse"
112112
>
113-
<stop stop-color="#52525B" />
114-
<stop offset="1" stop-color="#A1A1AA" />
113+
<stop stopColor="#52525B" />
114+
<stop offset="1" stopColor="#A1A1AA" />
115115
</linearGradient>
116116
<linearGradient
117117
id="paint3_linear_6594_388107"
@@ -121,8 +121,8 @@ const FileThumbnail = () => {
121121
y2="21.25"
122122
gradientUnits="userSpaceOnUse"
123123
>
124-
<stop stop-color="#18181B" />
125-
<stop offset="1" stop-color="#52525B" />
124+
<stop stopColor="#18181B" />
125+
<stop offset="1" stopColor="#52525B" />
126126
</linearGradient>
127127
</defs>
128128
</svg>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "./form";
1+
export * from "./form"

packages/admin/dashboard/src/components/common/infinite-list/infinite-list.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type InfiniteListProps<TResponse, TEntity, TParams> = {
1616
export const InfiniteList = <
1717
TResponse extends { count: number; offset: number; limit: number },
1818
TEntity extends { id: string },
19-
TParams extends { offset?: number; limit?: number },
19+
TParams extends { offset?: number; limit?: number }
2020
>({
2121
queryKey,
2222
queryFn,
@@ -119,12 +119,7 @@ export const InfiniteList = <
119119
startObserver.current?.disconnect()
120120
endObserver.current?.disconnect()
121121
}
122-
}, [
123-
hasNextPage,
124-
hasPreviousPage,
125-
isFetching,
126-
isPending,
127-
])
122+
}, [hasNextPage, hasPreviousPage, isFetching, isPending])
128123

129124
useEffect(() => {
130125
if (error) {

packages/admin/dashboard/src/components/common/logo-box/logo-box.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ export const LogoBox = ({
2525
return (
2626
<div
2727
className={clx(
28-
"size-14 bg-ui-button-neutral shadow-buttons-neutral relative flex items-center justify-center rounded-xl",
28+
"bg-ui-button-neutral shadow-buttons-neutral relative flex size-14 items-center justify-center rounded-xl",
2929
"after:button-neutral-gradient after:inset-0 after:content-['']",
3030
className
3131
)}
3232
>
3333
{checked && (
3434
<motion.div
35-
className="size-5 absolute -right-[5px] -top-1 flex items-center justify-center rounded-full border-[0.5px] border-[rgba(3,7,18,0.2)] bg-[#3B82F6] bg-gradient-to-b from-white/0 to-white/20 shadow-[0px_1px_2px_0px_rgba(3,7,18,0.12),0px_1px_2px_0px_rgba(255,255,255,0.10)_inset,0px_-1px_5px_0px_rgba(255,255,255,0.10)_inset,0px_0px_0px_0px_rgba(3,7,18,0.06)_inset]"
35+
className="absolute -right-[5px] -top-1 flex size-5 items-center justify-center rounded-full border-[0.5px] border-[rgba(3,7,18,0.2)] bg-[#3B82F6] bg-gradient-to-b from-white/0 to-white/20 shadow-[0px_1px_2px_0px_rgba(3,7,18,0.12),0px_1px_2px_0px_rgba(255,255,255,0.10)_inset,0px_-1px_5px_0px_rgba(255,255,255,0.10)_inset,0px_0px_0px_0px_rgba(3,7,18,0.06)_inset]"
3636
initial={{ opacity: 0, scale: 0.5 }}
3737
animate={{ opacity: 1, scale: 1 }}
3838
transition={containerTransition}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
export * from "./segmented-control"
2-

packages/admin/dashboard/src/components/common/switch-box/switch-box.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { Form } from "../../common/form"
66

77
interface HeadlessControllerProps<
88
TFieldValues extends FieldValues = FieldValues,
9-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
9+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
1010
> extends Omit<ControllerProps<TFieldValues, TName>, "render"> {}
1111

1212
interface SwitchBoxProps<
1313
TFieldValues extends FieldValues = FieldValues,
14-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
14+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
1515
> extends HeadlessControllerProps<TFieldValues, TName> {
1616
label: string
1717
description: string
@@ -32,7 +32,7 @@ interface SwitchBoxProps<
3232
*/
3333
export const SwitchBox = <
3434
TFieldValues extends FieldValues = FieldValues,
35-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
35+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
3636
>({
3737
label,
3838
description,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "./thumbnail";
1+
export * from "./thumbnail"

packages/admin/dashboard/src/components/common/user-link/user-link.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ export const By = ({ id }: { id: string }) => {
4242
return null
4343
}
4444

45+
// eslint-disable-next-line react-hooks/rules-of-hooks
4546
const { user } = useUser(id, undefined, { enabled: isUser }) // todo: extend to support customers
47+
// eslint-disable-next-line react-hooks/rules-of-hooks
4648
const { customer } = useCustomer(id, undefined, { enabled: isCustomer })
4749

4850
const actor = isUser ? user : customer

packages/admin/dashboard/src/components/data-grid/components/data-grid-multiline-cell.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,3 @@ const Inner = ({
100100
/>
101101
)
102102
}
103-

packages/admin/dashboard/src/components/data-grid/components/data-grid-textarea-modal-cell.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { clx, Textarea } from "@medusajs/ui"
22
import { Popover as RadixPopover } from "radix-ui"
3-
import { useCallback, useEffect, useRef, useState } from "react"
3+
import React, { useCallback, useEffect, useRef, useState } from "react"
44
import { Controller, ControllerRenderProps } from "react-hook-form"
55

66
import { useCombinedRefs } from "../../../hooks/use-combined-refs"
77
import { useDataGridCell, useDataGridCellError } from "../hooks"
88
import { useDataGridContext } from "../context"
9-
import { DataGridCellProps, InputProps, DataGridCellContext } from "../types"
9+
import { DataGridCellProps, InputProps } from "../types"
1010
import { DataGridCellContainer } from "./data-grid-cell-container"
1111

1212
type DataGridExpandableTextCellProps<TData, TValue = any> = DataGridCellProps<

0 commit comments

Comments
 (0)