From b1d2fb986f7bba7f4fa4bf06ebeb0fc522c4369a Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 21 Jul 2026 23:07:10 -0400 Subject: [PATCH] chore: Address 11 lint warnings (#13092) --- app/components/DocumentBreadcrumb.tsx | 2 +- app/components/Table.tsx | 4 ++-- app/editor/menus/tableCol.tsx | 16 +++++++--------- app/editor/menus/tableRow.tsx | 16 +++++++--------- .../Document/components/PresentationMode.tsx | 8 +++----- server/__mocks__/bull.ts | 2 +- server/routes/api/groups/groups.ts | 2 +- server/routes/api/users/users.test.ts | 2 +- shared/editor/plugins/AnchorPlugin.ts | 2 +- shared/editor/plugins/CodeHighlightingPlugin.ts | 3 +-- 10 files changed, 25 insertions(+), 32 deletions(-) diff --git a/app/components/DocumentBreadcrumb.tsx b/app/components/DocumentBreadcrumb.tsx index 558d968adf..a64161ae92 100644 --- a/app/components/DocumentBreadcrumb.tsx +++ b/app/components/DocumentBreadcrumb.tsx @@ -213,7 +213,7 @@ function DocumentBreadcrumb( ...(collectionLabel ? [collectionLabel] : []), ...(omitted.length ? [ - + … , ] diff --git a/app/components/Table.tsx b/app/components/Table.tsx index bbaf81380c..106cab6523 100644 --- a/app/components/Table.tsx +++ b/app/components/Table.tsx @@ -311,9 +311,9 @@ function Placeholder({ return ( - {new Array(rows).fill(1).map((_r, row) => ( + {Array.from({ length: rows }).map((_r, row) => ( - {new Array(columns).fill(1).map((_c, col) => ( + {Array.from({ length: columns }).map((_c, col) => ( diff --git a/app/editor/menus/tableCol.tsx b/app/editor/menus/tableCol.tsx index bd6428320b..f3a8aa103d 100644 --- a/app/editor/menus/tableCol.tsx +++ b/app/editor/menus/tableCol.tsx @@ -163,15 +163,13 @@ export default function tableColMenuItems(ctx: SelectionContext): MenuItem[] { ), children: [ - ...[ - { - name: "toggleColumnBackgroundAndCollapseSelection", - label: t("None"), - icon: , - active: () => (hasBackground ? false : true), - attrs: { color: null }, - }, - ], + { + name: "toggleColumnBackgroundAndCollapseSelection", + label: t("None"), + icon: , + active: () => (hasBackground ? false : true), + attrs: { color: null }, + }, ...TableCell.presetColors.map((preset) => ({ name: "toggleColumnBackgroundAndCollapseSelection", label: preset.name, diff --git a/app/editor/menus/tableRow.tsx b/app/editor/menus/tableRow.tsx index d148756e2b..592debf67d 100644 --- a/app/editor/menus/tableRow.tsx +++ b/app/editor/menus/tableRow.tsx @@ -150,15 +150,13 @@ export default function tableRowMenuItems(ctx: SelectionContext): MenuItem[] { ), children: [ - ...[ - { - name: "toggleRowBackgroundAndCollapseSelection", - label: t("None"), - icon: , - active: () => (hasBackground ? false : true), - attrs: { color: null }, - }, - ], + { + name: "toggleRowBackgroundAndCollapseSelection", + label: t("None"), + icon: , + active: () => (hasBackground ? false : true), + attrs: { color: null }, + }, ...TableCell.presetColors.map((preset) => ({ name: "toggleRowBackgroundAndCollapseSelection", label: preset.name, diff --git a/app/scenes/Document/components/PresentationMode.tsx b/app/scenes/Document/components/PresentationMode.tsx index 5bf1cfaa9d..936793c0ff 100644 --- a/app/scenes/Document/components/PresentationMode.tsx +++ b/app/scenes/Document/components/PresentationMode.tsx @@ -143,11 +143,9 @@ function PresentationMode({ title, icon, iconColor, data, onClose }: Props) { const slides = React.useMemo(() => { const result = splitIntoSlides(strippedData, title, icon, iconColor); const contentSlides = result.filter((s) => s.type === "content"); - const hasContent = - contentSlides.length > 0 && - contentSlides.some( - (s) => s.type === "content" && !isContentEmpty(s.content) - ); + const hasContent = contentSlides.some( + (s) => s.type === "content" && !isContentEmpty(s.content) + ); if (!hasContent) { return [result[0], { type: "instructions" as const }]; diff --git a/server/__mocks__/bull.ts b/server/__mocks__/bull.ts index 1fe4350589..dda39182ec 100644 --- a/server/__mocks__/bull.ts +++ b/server/__mocks__/bull.ts @@ -24,7 +24,7 @@ export default class Queue { return; } - this.handler(job, this.done); + this.handler(job, () => this.done()); } process(handler: (job: unknown, done: () => void) => void) { diff --git a/server/routes/api/groups/groups.ts b/server/routes/api/groups/groups.ts index 40ce677226..bc869fd30f 100644 --- a/server/routes/api/groups/groups.ts +++ b/server/routes/api/groups/groups.ts @@ -122,7 +122,7 @@ router.post( where = { ...where, id: { - ...((where.id as object) ?? {}), + ...(where.id as object), [source === "manual" ? Op.notIn : Op.in]: sourceGroupIds, }, }; diff --git a/server/routes/api/users/users.test.ts b/server/routes/api/users/users.test.ts index b1d269fecb..cf37919658 100644 --- a/server/routes/api/users/users.test.ts +++ b/server/routes/api/users/users.test.ts @@ -499,7 +499,7 @@ describe("#users.invite", () => { const user = await buildUser(); const res = await server.post("/api/users.invite", user, { body: { - invites: new Array(21).fill({ + invites: Array.from({ length: 21 }).fill({ email: "test@example.com", name: "Test", role: "viewer", diff --git a/shared/editor/plugins/AnchorPlugin.ts b/shared/editor/plugins/AnchorPlugin.ts index cf16bfc207..cba28f57d3 100644 --- a/shared/editor/plugins/AnchorPlugin.ts +++ b/shared/editor/plugins/AnchorPlugin.ts @@ -84,7 +84,7 @@ export class AnchorPlugin extends Plugin { const anchors = ProsemirrorHelper.getAnchors(state.doc); return DecorationSet.create( state.doc, - anchors.map(this.createAnchorDecoration) + anchors.map((anchor) => this.createAnchorDecoration(anchor)) ); } } diff --git a/shared/editor/plugins/CodeHighlightingPlugin.ts b/shared/editor/plugins/CodeHighlightingPlugin.ts index 1a1ffc887f..a721489c73 100644 --- a/shared/editor/plugins/CodeHighlightingPlugin.ts +++ b/shared/editor/plugins/CodeHighlightingPlugin.ts @@ -114,8 +114,7 @@ function getDecorations({ (block.node.textContent.match(/\n/g) || []).length + 1; const gutterWidth = String(lineCount).length; - const lineCountText = new Array(lineCount) - .fill(0) + const lineCountText = Array.from({ length: lineCount }) .map((_, i) => padStart(`${i + 1}`, gutterWidth, " ")) .join("\n");