Skip to content

Commit d9fe80e

Browse files
Merge pull request #510 from gridaco/canary
chore: eslint
2 parents b9240a1 + 0a14c66 commit d9fe80e

File tree

51 files changed

+318
-236
lines changed

Some content is hidden

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

51 files changed

+318
-236
lines changed

apps/viewer/empty-module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
export default {};
1+
const empty = {};
2+
export default empty;

editor/app/(dev)/canvas/tools/io-svg/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export default function IOSVGPage() {
167167
<div className="flex w-full h-96 p-4 border overflow-scroll">
168168
<div className="flex-1">
169169
{raw ? (
170+
// eslint-disable-next-line @next/next/no-img-element -- Intentional: render a data: SVG preview (Next/Image not applicable).
170171
<img
171172
src={`data:image/svg+xml;utf8,${encodeURIComponent(raw)}`}
172173
alt="raw svg"

editor/app/(workbench)/[org]/[proj]/(console)/(campaign)/campaigns/[campaign]/_components/overview.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,7 @@ export default function Overview() {
222222
function MainChart({ data }: { data: AnalyzedData }) {
223223
const [chartData, setChartData] = useState<any[]>([]);
224224

225-
useEffect(() => {
226-
processData(data);
227-
}, [data]);
228-
229-
const processData = (data: AnalyzedData) => {
225+
function processData(data: AnalyzedData) {
230226
if (!data.events.length) return;
231227

232228
const grouped = Analytics.serialize(data.events, {
@@ -266,7 +262,11 @@ function MainChart({ data }: { data: AnalyzedData }) {
266262
(a, b) => a.date.getTime() - b.date.getTime()
267263
);
268264
setChartData(chartData);
269-
};
265+
}
266+
267+
useEffect(() => {
268+
processData(data);
269+
}, [data]);
270270

271271
return (
272272
<ChartContainer

editor/app/(workbench)/[org]/[proj]/(console)/(campaign)/campaigns/[campaign]/design/_enterprise/west-referral-duo-001-editor.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,14 @@ function RightPanelTab({
6868
<TabsContent value={value} className="m-0 h-full min-h-0">
6969
<Card className="h-full min-h-0 flex flex-col overflow-hidden">
7070
<CardHeader className="flex-none">
71-
<CardTitle className={action ? "flex justify-between items-center" : ""}>
71+
<CardTitle
72+
className={action ? "flex justify-between items-center" : ""}
73+
>
7274
<span>{title}</span>
7375
{action ? <span>{action}</span> : null}
7476
</CardTitle>
7577
</CardHeader>
76-
{/*
78+
{/*
7779
Important: stop wheel/touch bubbling so canvas-level handlers
7880
can't steal scroll when cursor is over the right panel.
7981
*/}
@@ -327,7 +329,8 @@ function TemplateEditor({
327329
<FieldLabel>Article</FieldLabel>
328330
<CMSRichText
329331
value={
330-
values?.components?.["referrer-share"]?.article?.html ?? ""
332+
values?.components?.["referrer-share"]?.article?.html ??
333+
""
331334
}
332335
uploader={template.upload}
333336
onValueChange={(value) => {
@@ -341,7 +344,9 @@ function TemplateEditor({
341344
<Field>
342345
<FieldLabel>Consent</FieldLabel>
343346
<Textarea
344-
value={values?.components?.["referrer-share"]?.consent ?? ""}
347+
value={
348+
values?.components?.["referrer-share"]?.consent ?? ""
349+
}
345350
onChange={(e) => {
346351
props.set(
347352
"components.referrer-share.consent",
@@ -356,7 +361,10 @@ function TemplateEditor({
356361
<Input
357362
value={values?.components?.referrer?.cta}
358363
onChange={(e) => {
359-
props.set("components.referrer-share.cta", e.target.value);
364+
props.set(
365+
"components.referrer-share.cta",
366+
e.target.value
367+
);
360368
}}
361369
placeholder="Button Text"
362370
/>
@@ -477,7 +485,9 @@ function TemplateEditor({
477485
<Field>
478486
<FieldLabel>Description</FieldLabel>
479487
<Textarea
480-
value={values?.components?.invitation?.description as string}
488+
value={
489+
values?.components?.invitation?.description as string
490+
}
481491
onChange={(e) => {
482492
props.set(
483493
"components.invitation.description",

editor/app/(workbench)/[org]/[proj]/(console)/(resources)/customers/[uid]/page.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -439,18 +439,10 @@ export default function CustomerDetailPage(props0: {
439439
</DropdownMenu>
440440
{/* TODO: db cursor navigation */}
441441
<ButtonGroup>
442-
<Button
443-
disabled
444-
variant="outline"
445-
size="sm"
446-
>
442+
<Button disabled variant="outline" size="sm">
447443
<ChevronLeft className="size-4" />
448444
</Button>
449-
<Button
450-
disabled
451-
variant="outline"
452-
size="sm"
453-
>
445+
<Button disabled variant="outline" size="sm">
454446
<ChevronRight className="size-4" />
455447
</Button>
456448
</ButtonGroup>

editor/app/(workbench)/[org]/[proj]/(console)/(resources)/www/page.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { useProject } from "@/scaffolds/workspace";
1515
import { useCallback, useMemo } from "react";
1616
import useSWR, { mutate } from "swr";
1717
import { Spinner } from "@/components/ui/spinner";
18-
import { useForm } from "react-hook-form";
18+
import { useForm, useWatch } from "react-hook-form";
1919
import { Skeleton } from "@/components/ui/skeleton";
2020
import { FaviconEditor } from "@/scaffolds/www-theme-config/components/favicon";
2121
import { SiteDomainsSection } from "./section-domain";
@@ -280,6 +280,15 @@ function FormSiteGeneral({
280280
});
281281

282282
const { isSubmitting, isDirty } = form.formState;
283+
const watched = useWatch({
284+
control: form.control,
285+
defaultValue: defaultValues,
286+
});
287+
const values: SiteGeneral = {
288+
title: watched?.title ?? defaultValues.title,
289+
description: watched?.description ?? defaultValues.description,
290+
lang: watched?.lang ?? defaultValues.lang,
291+
};
283292

284293
return (
285294
<Card>
@@ -290,7 +299,7 @@ function FormSiteGeneral({
290299
<SiteGeneralSection
291300
url={url}
292301
disabled={isSubmitting}
293-
value={form.watch()}
302+
value={values}
294303
onValueChange={({ title, description, lang }) => {
295304
form.setValue("title", title, { shouldDirty: true });
296305
form.setValue("description", description, { shouldDirty: true });

editor/components/ai-elements/message.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ export function MessageAttachment({
346346
>
347347
{isImage ? (
348348
<>
349+
{/* eslint-disable-next-line @next/next/no-img-element -- Intentional: remote/user-provided attachment URL (avoid Next/Image constraints here). */}
349350
<img
350351
alt={filename || "attachment"}
351352
className="size-full object-cover"

editor/components/ai-elements/prompt-input.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ export function PromptInputAttachment({
294294
<div className="relative size-5 shrink-0">
295295
<div className="absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded bg-background transition-opacity group-hover:opacity-0">
296296
{isImage ? (
297+
// eslint-disable-next-line @next/next/no-img-element -- Intentional: remote/user-provided attachment URL (avoid Next/Image constraints here).
297298
<img
298299
alt={filename || "attachment"}
299300
className="size-5 object-cover"
@@ -329,6 +330,7 @@ export function PromptInputAttachment({
329330
<div className="w-auto space-y-3">
330331
{isImage && (
331332
<div className="flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border">
333+
{/* eslint-disable-next-line @next/next/no-img-element -- Intentional: remote/user-provided attachment preview (avoid Next/Image constraints here). */}
332334
<img
333335
alt={filename || "attachment preview"}
334336
className="max-h-full max-w-full object-contain"

editor/components/ai-elements/queue.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ export const QueueItemImage = ({
151151
className,
152152
...props
153153
}: QueueItemImageProps) => (
154+
// eslint-disable-next-line @next/next/no-img-element -- Intentional: tiny inline thumbnail (avoid Next/Image constraints here).
154155
<img
155156
alt=""
156157
className={cn("h-8 w-8 rounded border object-cover", className)}

editor/components/ai-elements/shimmer.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import { cn } from "@/components/lib/utils/index";
3+
import { cn } from "@/components/lib/utils";
44
import { motion } from "motion/react";
55
import {
66
type CSSProperties,
@@ -10,13 +10,13 @@ import {
1010
useMemo,
1111
} from "react";
1212

13-
export type TextShimmerProps = {
13+
export interface TextShimmerProps {
1414
children: string;
1515
as?: ElementType;
1616
className?: string;
1717
duration?: number;
1818
spread?: number;
19-
};
19+
}
2020

2121
const ShimmerComponent = ({
2222
children,
@@ -35,6 +35,7 @@ const ShimmerComponent = ({
3535
);
3636

3737
return (
38+
// eslint-disable-next-line react-hooks/static-components -- its from https://ai-sdk.dev/elements/components/shimmer, we dont have code ownership over it.
3839
<MotionComponent
3940
animate={{ backgroundPosition: "0% center" }}
4041
className={cn(

0 commit comments

Comments
 (0)