chore: run fixes (#8257)

* chore: run fixes

* fix: type, just use hocuspocusservercontext

* fix: codemod

---------

Co-authored-by: Palanikannan M <akashmalinimurugu@gmail.com>
This commit is contained in:
Aaron 2025-12-08 23:56:50 +07:00 committed by GitHub
parent a9e9cb2983
commit 0ab94ed6d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
172 changed files with 1784 additions and 1798 deletions

View file

@ -53,7 +53,7 @@ export function CalloutBlockLogoSelector(props: Props) {
};
if (val.type === "emoji") {
// val.value is now a string in decimal format (e.g. "128512")
const emojiValue = val.value as string;
const emojiValue = val.value;
newLogoValue = {
"data-emoji-unicode": emojiValue,
"data-emoji-url": undefined,

View file

@ -80,7 +80,7 @@ export function CustomImageBlock(props: CustomImageBlockProps) {
if (editorContainer) {
closestEditorContainer = editorContainer;
} else {
closestEditorContainer = img.closest(".editor-container") as HTMLDivElement | null;
closestEditorContainer = img.closest(".editor-container");
if (!closestEditorContainer) {
console.error("Editor container not found");
return;

View file

@ -81,7 +81,7 @@ export function CustomImageNodeView(props: CustomImageNodeViewProps) {
try {
hasRetriedOnMount.current = true;
const newAssetId = await extension.options.duplicateImage!(imgNodeSrc);
const newAssetId = await extension.options.duplicateImage(imgNodeSrc);
if (!newAssetId) {
throw new Error("Duplication returned invalid asset ID");

View file

@ -152,7 +152,7 @@ export const Emoji = Node.create<EmojiOptions, EmojiStorage>({
return {
...versions,
[version as number]: emoji ? isEmojiSupported(emoji.emoji as string) : false,
[version]: emoji ? isEmojiSupported(emoji.emoji as string) : false,
};
}, {});

View file

@ -25,7 +25,7 @@ export const EmojiExtension = Emoji.extend({
},
}).configure({
// Filter out emojis without emoji value and remove fallbackImage property to prevent CDN calls
// eslint-disable-next-line @typescript-eslint/no-unused-vars
emojis: gitHubEmojis.filter((item) => item.emoji).map(({ fallbackImage, ...emoji }) => emoji),
suggestion: emojiSuggestion,
enableEmoticons: true,

View file

@ -7,7 +7,6 @@ import { canJoin } from "@tiptap/pm/transform";
import { CORE_EXTENSIONS } from "@/constants/extension";
declare module "@tiptap/core" {
// eslint-disable-next-line no-unused-vars
interface Commands<ReturnType> {
customKeymap: {
/**

View file

@ -44,7 +44,6 @@ export const TrailingNode = Extension.create<TrailingNodeOptions>({
return;
}
// eslint-disable-next-line consistent-return
return tr.insert(endPosition, type.create());
},
state: {

View file

@ -27,7 +27,6 @@ function scrollToNode(editor: Editor, pos: number): void {
}
}
// eslint-disable-next-line no-undef
export function scrollToNodeViaDOMCoordinates(editor: Editor, pos: number, behavior?: ScrollBehavior): void {
const view = editor.view;

View file

@ -129,7 +129,7 @@ export type EditorRefApi = {
onStateChange: (callback: () => void) => () => void;
redo: () => void;
scrollSummary: (marking: IMarking) => void;
// eslint-disable-next-line no-undef
scrollToNodeViaDOMCoordinates: ({ pos, behavior }: { pos?: number; behavior?: ScrollBehavior }) => void;
setEditorValue: (content: string, emitUpdate?: boolean) => void;
setEditorValueAtCursorPosition: (content: string) => void;