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

@@ -139,7 +139,7 @@ class LinkEditor extends React.Component<Props, State> {
if (result) {
this.save(result.url, result.title);
} else if (onCreateLink && selectedIndex === results.length) {
this.handleCreateLink(this.suggestedLinkTitle);
void this.handleCreateLink(this.suggestedLinkTitle);
}
} else {
// saves the raw input as href
@@ -376,8 +376,8 @@ class LinkEditor extends React.Component<Props, State> {
subtitle={dictionary.createNewDoc}
icon={<PlusIcon />}
onPointerMove={() => this.handleFocusLink(results.length)}
onClick={() => {
this.handleCreateLink(suggestedLinkTitle);
onClick={async () => {
await this.handleCreateLink(suggestedLinkTitle);
if (this.initialSelectionLength) {
this.moveSelectionToEnd();

View File

@@ -22,7 +22,7 @@ function LinkSearchResult({
const ref = React.useCallback(
(node: HTMLElement | null) => {
if (selected && node) {
scrollIntoView(node, {
void scrollIntoView(node, {
scrollMode: "if-needed",
block: "center",
boundary: (parent) =>

View File

@@ -82,7 +82,7 @@ export default function LinkToolbar({
)
);
createAndInsertLink(view, title, href, {
return createAndInsertLink(view, title, href, {
onCreateLink,
onShowToast: showToast,
dictionary,

View File

@@ -54,7 +54,7 @@ function MentionMenu({ search, isActive, ...rest }: Props) {
React.useEffect(() => {
if (isActive) {
request();
void request();
}
}, [request, isActive]);

View File

@@ -159,7 +159,7 @@ export default function SelectionToolbar(props: Props) {
.addMark(from, to, markType.create({ href }))
);
createAndInsertLink(view, title, href, {
return createAndInsertLink(view, title, href, {
onCreateLink,
onShowToast,
dictionary,

View File

@@ -25,7 +25,7 @@ function SuggestionsMenuItem({
const ref = React.useCallback(
(node) => {
if (selected && node) {
scrollIntoView(node, {
void scrollIntoView(node, {
scrollMode: "if-needed",
block: "nearest",
boundary: (parent) =>