Skip to content

Commit 8c637d2

Browse files
committed
fix: lint fixes
1 parent e7a2276 commit 8c637d2

6 files changed

Lines changed: 35 additions & 23 deletions

File tree

packages/imagekit-editor-dev/src/components/header/TemplateNameInput.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ export function TemplateNameInput() {
7979
variant="unstyled"
8080
fontWeight="medium"
8181
fontSize="md"
82-
color={isDefault ? "editorBattleshipGrey.500" : "editorBattleshipGrey.900"}
82+
color={
83+
isDefault ? "editorBattleshipGrey.500" : "editorBattleshipGrey.900"
84+
}
8385
placeholder={UNTITLED}
8486
_placeholder={{ color: "editorBattleshipGrey.500" }}
8587
width="auto"

packages/imagekit-editor-dev/src/components/header/TemplatesDropdown.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ interface TemplatesDropdownProps {
3535
onViewAllTemplates?: () => void
3636
}
3737

38-
export function TemplatesDropdown({ onViewAllTemplates }: TemplatesDropdownProps) {
38+
export function TemplatesDropdown({
39+
onViewAllTemplates,
40+
}: TemplatesDropdownProps) {
3941
const provider = useTemplateStorage()
4042
const { isOpen, onOpen, onClose } = useDisclosure()
4143
const [templates, setTemplates] = useState<TemplateRecord[]>([])
@@ -171,7 +173,11 @@ export function TemplatesDropdown({ onViewAllTemplates }: TemplatesDropdownProps
171173
overflow="hidden"
172174
borderWidth="0"
173175
outline="none"
174-
_focus={{ boxShadow: "lg", outline: "none", borderColor: "transparent" }}
176+
_focus={{
177+
boxShadow: "lg",
178+
outline: "none",
179+
borderColor: "transparent",
180+
}}
175181
>
176182
<PopoverBody p="0">
177183
<Flex

packages/imagekit-editor-dev/src/components/header/index.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ import {
1212
import { PiX } from "@react-icons/all-files/pi/PiX"
1313
import React from "react"
1414
import { useTemplateStorage } from "../../context/TemplateStorageContext"
15-
import { type FileElement, type RequiredMetadata, useEditorStore } from "../../store"
15+
import {
16+
type FileElement,
17+
type RequiredMetadata,
18+
useEditorStore,
19+
} from "../../store"
1620
import { TemplateNameInput } from "./TemplateNameInput"
1721
import { TemplateStatus } from "./TemplateStatus"
1822
import { TemplatesDropdown } from "./TemplatesDropdown"
@@ -50,7 +54,11 @@ export interface HeaderProps<
5054
onViewAllTemplates?: () => void
5155
}
5256

53-
export const Header = ({ onClose, exportOptions, onViewAllTemplates }: HeaderProps) => {
57+
export const Header = ({
58+
onClose,
59+
exportOptions,
60+
onViewAllTemplates,
61+
}: HeaderProps) => {
5462
const { imageList, originalImageList, currentImage } = useEditorStore()
5563
const provider = useTemplateStorage()
5664

packages/imagekit-editor-dev/src/hooks/useAutoSaveTemplate.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ export function useAutoSaveTemplate() {
6464
} catch (err) {
6565
setSyncStatus(
6666
"error",
67-
err instanceof Error ? err.message : "Failed to auto-save template",
67+
err instanceof Error
68+
? err.message
69+
: "Failed to auto-save template",
6870
)
6971
}
7072
}, DEBOUNCE_MS)

packages/imagekit-editor-dev/src/schema/index.ts

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -709,21 +709,16 @@ const baseTransformationSchema: TransformationSchema[] = [
709709
// z.preprocess normalises legacy string values that were coerced
710710
// from the array before this fix (e.g. "horizontal",
711711
// "horizontal,vertical", or corrupted "h,,,o,r,i,z,n,t,a,l,...").
712-
flip: z.preprocess(
713-
(val) => {
714-
if (Array.isArray(val)) return val
715-
if (typeof val === "string" && val) {
716-
return val
717-
.split(",")
718-
.map((s) => s.trim())
719-
.filter(
720-
(s) => s === "horizontal" || s === "vertical",
721-
)
722-
}
723-
return []
724-
},
725-
z.array(z.enum(["horizontal", "vertical"])).optional(),
726-
),
712+
flip: z.preprocess((val) => {
713+
if (Array.isArray(val)) return val
714+
if (typeof val === "string" && val) {
715+
return val
716+
.split(",")
717+
.map((s) => s.trim())
718+
.filter((s) => s === "horizontal" || s === "vertical")
719+
}
720+
return []
721+
}, z.array(z.enum(["horizontal", "vertical"])).optional()),
727722
})
728723
.refine(
729724
(val) => {

packages/imagekit-editor-dev/src/storage/localStorage-provider.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ function normalizeRecord(raw: Record<string, unknown>): TemplateRecord {
2020
return {
2121
id: (raw.id as string) || generateId(),
2222
clientNumber: (raw.clientNumber as string) || "local",
23-
isPrivate:
24-
raw.isPrivate !== undefined ? (raw.isPrivate as boolean) : true,
23+
isPrivate: raw.isPrivate !== undefined ? (raw.isPrivate as boolean) : true,
2524
name: (raw.name as string) || "",
2625
transformations:
2726
(raw.transformations as TemplateRecord["transformations"]) || [],

0 commit comments

Comments
 (0)