From 957ddf9f5d7b7aa1cab9ef3257a484ed5ec4f372 Mon Sep 17 00:00:00 2001 From: Nick the Sick Date: Sat, 21 Mar 2026 23:03:01 +0100 Subject: [PATCH] refactor: replace @ts-ignore with @ts-expect-error for stricter type suppression Replace all 5 @ts-ignore comments with @ts-expect-error across the codebase. @ts-expect-error will flag when suppressions become unnecessary, preventing stale type suppressions from accumulating. Nightshift-Task: lint-fix Nightshift-Ref: https://github.com/marcus/nightshift Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/core/src/editor/BlockNoteEditor.ts | 2 +- packages/core/src/schema/inlineContent/types.ts | 2 +- packages/xl-ai/src/api/formats/tests/sharedTestCases.ts | 2 +- packages/xl-ai/src/prosemirror/rebaseTool.ts | 2 +- packages/xl-odt-exporter/src/odt/odtExporter.test.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/src/editor/BlockNoteEditor.ts b/packages/core/src/editor/BlockNoteEditor.ts index 2a6648f04b..cb65cc3f8d 100644 --- a/packages/core/src/editor/BlockNoteEditor.ts +++ b/packages/core/src/editor/BlockNoteEditor.ts @@ -423,7 +423,7 @@ export class BlockNoteEditor< }, }; - // @ts-ignore + // @ts-expect-error - schema type mismatch due to conditional default this.schema = newOptions.schema; this.blockImplementations = newOptions.schema.blockSpecs; this.inlineContentImplementations = newOptions.schema.inlineContentSpecs; diff --git a/packages/core/src/schema/inlineContent/types.ts b/packages/core/src/schema/inlineContent/types.ts index 4dca7a0aa3..9063e9a8fe 100644 --- a/packages/core/src/schema/inlineContent/types.ts +++ b/packages/core/src/schema/inlineContent/types.ts @@ -15,7 +15,7 @@ export type InlineContentConfig = CustomInlineContentConfig | "text" | "link"; // InlineContentImplementation contains the "implementation" info about an InlineContent element // such as the functions / Nodes required to render and / or serialize it -// @ts-ignore +// @ts-expect-error - T extends union but conditional type only narrows custom configs export type InlineContentImplementation = T extends "link" | "text" ? undefined diff --git a/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts b/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts index c15e9302eb..078af4f4ee 100644 --- a/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts +++ b/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts @@ -20,7 +20,7 @@ import { buildAIRequest } from "../../aiRequest/builder.js"; const BASE_FILE_PATH = path.resolve(__dirname, "__snapshots__"); -// @ts-ignore +// @ts-expect-error - unused helper kept for debugging snapshots // eslint-disable-next-line @typescript-eslint/no-unused-vars async function matchFileSnapshot(data: any, postFix = "") { const t = getCurrentTest()!; diff --git a/packages/xl-ai/src/prosemirror/rebaseTool.ts b/packages/xl-ai/src/prosemirror/rebaseTool.ts index 7794e208a2..18c053edd2 100644 --- a/packages/xl-ai/src/prosemirror/rebaseTool.ts +++ b/packages/xl-ai/src/prosemirror/rebaseTool.ts @@ -12,7 +12,7 @@ export function getApplySuggestionsTr(editor: BlockNoteEditor) { applySuggestionsTr = tr; }); - // @ts-ignore + // @ts-expect-error - applySuggestionsTr is assigned inside the callback above if (!applySuggestionsTr) { throw new Error("applySuggestionsTr is not set"); } diff --git a/packages/xl-odt-exporter/src/odt/odtExporter.test.ts b/packages/xl-odt-exporter/src/odt/odtExporter.test.ts index 9e4e8b2db8..951500eed6 100644 --- a/packages/xl-odt-exporter/src/odt/odtExporter.test.ts +++ b/packages/xl-odt-exporter/src/odt/odtExporter.test.ts @@ -13,7 +13,7 @@ import { ColumnBlock, ColumnListBlock } from "@blocknote/xl-multi-column"; import { partialBlocksToBlocksForTesting } from "@shared/formatConversionTestUtil.js"; beforeAll(async () => { - // @ts-ignore + // @ts-expect-error - Blob polyfill for Node test environment globalThis.Blob = (await import("node:buffer")).Blob; });