fix: eslint warnings and errors (#7479)

This commit is contained in:
Aaryan Khandelwal
2025-07-25 13:40:25 +05:30
committed by GitHub
parent 57479f4554
commit f8353d3468
4 changed files with 12 additions and 16 deletions

View File

@@ -1,3 +1,5 @@
// TODO: check all the type errors and fix them
import { findChildren } from "@tiptap/core";
import { Node as ProsemirrorNode } from "@tiptap/pm/model";
import { Plugin, PluginKey } from "@tiptap/pm/state";
@@ -117,19 +119,15 @@ export function LowlightPlugin({
// Such transactions can happen during collab syncing via y-prosemirror, for example.
transaction.steps.some(
(step) =>
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
// @ts-expect-error type error
step.from !== undefined &&
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
// @ts-expect-error type error
step.to !== undefined &&
oldNodes.some(
(node) =>
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
// @ts-expect-error type error
node.pos >= step.from &&
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
// @ts-expect-error type error
node.pos + node.node.nodeSize <= step.to
)
))

View File

@@ -32,11 +32,8 @@ function scrollToNode(editor: Editor, pos: number): void {
}
}
export function scrollToNodeViaDOMCoordinates(
editor: Editor,
pos: number,
behavior?: "auto" | "smooth" | "instant"
): void {
// eslint-disable-next-line no-undef
export function scrollToNodeViaDOMCoordinates(editor: Editor, pos: number, behavior?: ScrollBehavior): void {
const view = editor.view;
// Get the coordinates of the position

View File

@@ -111,7 +111,8 @@ export interface EditorRefApi extends EditorReadOnlyRefApi {
onDocumentInfoChange: (callback: (documentInfo: TDocumentInfo) => void) => () => void;
onHeadingChange: (callback: (headings: IMarking[]) => void) => () => void;
onStateChange: (callback: () => void) => () => void;
scrollToNodeViaDOMCoordinates: (behavior?: "auto" | "smooth" | "instant", position?: number) => void;
// eslint-disable-next-line no-undef
scrollToNodeViaDOMCoordinates: (behavior?: ScrollBehavior, position?: number) => void;
setEditorValueAtCursorPosition: (content: string) => void;
setFocusAtPosition: (position: number) => void;
setProviderDocument: (value: Uint8Array) => void;

View File

@@ -1,5 +1,5 @@
import { Editor, Range } from "@tiptap/core";
import { CSSProperties } from "react";
import type { Editor, Range } from "@tiptap/core";
import type { CSSProperties } from "react";
// types
import { TEditorCommands } from "@/types";