Skip to content

Commit 26e755d

Browse files
committed
chore: fix lint
1 parent 23d8be8 commit 26e755d

5 files changed

Lines changed: 15 additions & 6 deletions

File tree

packages/core/src/api/getBlockInfoFromPos.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function isSuggestedDeletionNode(node: Node): boolean {
5151
export function getNodeId(node: Node, doc: Node): string {
5252
const id = node.attrs.id;
5353
if (!id) {
54-
throw new Error(`Node ${node} does not have an ID`);
54+
throw new Error(`Node ${node.type.name} does not have an ID`);
5555
}
5656
/**
5757
* In suggestion mode, yjs will insert nodes which have actually been deleted but are kept in the document with a "y-attributed-delete" mark,
@@ -77,7 +77,9 @@ export function getNodeId(node: Node, doc: Node): string {
7777
return true; // continue the walk
7878
});
7979
if (!found) {
80-
throw new Error(`Node ${node} with ID ${id} not found in document`);
80+
throw new Error(
81+
`Node ${node.type.name} with ID ${id} not found in document`,
82+
);
8183
}
8284
return `${id}-${index}`;
8385
}

packages/core/src/extensions/Versioning/Versioning.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export const VersioningExtension = createExtension(
208208
previewedSnapshotId: id,
209209
}));
210210

211-
let compareToContent: unknown | undefined;
211+
let compareToContent: unknown;
212212
if (previewOptions?.compareTo) {
213213
compareToContent = await endpoints.getContent(previewOptions.compareTo);
214214
}

packages/core/src/y/versioning/yhub.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,14 @@ async function yhubFetch(
9898
): Promise<ArrayBuffer> {
9999
const res = await fetch(url, {
100100
...init,
101-
headers: { ...headers, ...init?.headers },
101+
headers: {
102+
...headers,
103+
...(init?.headers instanceof Headers
104+
? Object.fromEntries(init.headers.entries())
105+
: Array.isArray(init?.headers)
106+
? Object.fromEntries(init.headers)
107+
: init?.headers),
108+
},
102109
});
103110
if (!res.ok) {
104111
throw new Error(

packages/react/src/components/Versioning/CurrentSnapshot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const CurrentSnapshot = () => {
3434
event.preventDefault();
3535
event.stopPropagation();
3636

37-
createSnapshot({
37+
void createSnapshot({
3838
name: snapshotName !== "Current Version" ? snapshotName : undefined,
3939
});
4040
setSnapshotName("Current Version");

packages/react/src/components/Versioning/Snapshot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const Snapshot = ({
8585
event.preventDefault();
8686
event.stopPropagation();
8787

88-
restoreSnapshot?.(snapshot.id);
88+
void restoreSnapshot?.(snapshot.id);
8989
}}
9090
>
9191
Restore

0 commit comments

Comments
 (0)