Handle promise linting (#5488)

This commit is contained in:
Tom Moor
2023-06-28 20:18:18 -04:00
committed by GitHub
parent f3d8129a13
commit 89d5527d39
101 changed files with 395 additions and 343 deletions

View File

@@ -57,7 +57,7 @@ function CollectionLinkChildren({
if (!collection) {
return;
}
documents.move(item.id, collection.id, undefined, 0);
void documents.move(item.id, collection.id, undefined, 0);
},
collect: (monitor) => ({
isOverReorder: !!monitor.isOver(),

View File

@@ -36,7 +36,7 @@ function Collections() {
] = useDrop({
accept: "collection",
drop: async (item: DragObject) => {
collections.move(
void collections.move(
item.id,
fractionalIndex(null, orderedCollections[0].index)
);

View File

@@ -67,7 +67,7 @@ function InnerDocumentLink(
React.useEffect(() => {
if (isActiveDocument && hasChildDocuments) {
fetchChildDocuments(node.id);
void fetchChildDocuments(node.id);
}
}, [fetchChildDocuments, node, hasChildDocuments, isActiveDocument]);
@@ -115,7 +115,7 @@ function InnerDocumentLink(
);
const handlePrefetch = React.useCallback(() => {
prefetchDocument?.(node.id);
void prefetchDocument?.(node.id);
}, [prefetchDocument, node]);
const handleTitleChange = React.useCallback(
@@ -242,11 +242,11 @@ function InnerDocumentLink(
}
if (expanded) {
documents.move(item.id, collection.id, node.id, 0);
void documents.move(item.id, collection.id, node.id, 0);
return;
}
documents.move(item.id, collection.id, parentId, index + 1);
void documents.move(item.id, collection.id, parentId, index + 1);
},
collect: (monitor) => ({
isOverReorder: monitor.isOver(),

View File

@@ -51,7 +51,7 @@ function DraggableCollectionLink({
] = useDrop({
accept: "collection",
drop: (item: DragObject) => {
collections.move(
void collections.move(
item.id,
fractionalIndex(collection.index, belowCollectionIndex)
);

View File

@@ -40,7 +40,7 @@ function Starred() {
);
React.useEffect(() => {
fetchResults();
void fetchResults();
}, []);
const handleShowMore = async () => {
@@ -52,7 +52,7 @@ function Starred() {
const [{ isOverReorder, isDraggingAnyStar }, dropToReorder] = useDrop({
accept: "star",
drop: async (item: { star: Star }) => {
item.star.save({
void item.star.save({
index: fractionalIndex(null, stars.orderedData[0].index),
});
},

View File

@@ -90,13 +90,9 @@ function StarredLink({ star }: Props) {
}, [star.collectionId, ui.activeCollectionId, locationStateStarred]);
useEffect(() => {
async function load() {
if (documentId) {
await documents.fetch(documentId);
}
if (documentId) {
void documents.fetch(documentId);
}
load();
}, [documentId, documents]);
const handleDisclosureClick = React.useCallback(
@@ -134,7 +130,7 @@ function StarredLink({ star }: Props) {
drop: (item: { star: Star }) => {
const next = star?.next();
item.star.save({
void item.star.save({
index: fractionalIndex(star?.index || null, next?.index || null),
});
},

View File

@@ -36,7 +36,7 @@ export default function Version() {
}
}
loadReleases();
void loadReleases();
}, []);
return (