chore: fix eslint crashing issues (#1951)

This commit is contained in:
Mo
2022-11-04 17:09:54 -05:00
committed by GitHub
parent 5aa36ff071
commit 417c90a6f2
118 changed files with 315 additions and 424 deletions

View File

@@ -48,7 +48,7 @@ const ComponentView: FunctionComponent<IProps> = ({ application, onLoad, compone
const component: SNComponent = componentViewer.component
const manageSubscription = useCallback(() => {
openSubscriptionDashboard(application)
void openSubscriptionDashboard(application)
}, [application])
const reloadValidityStatus = useCallback(() => {

View File

@@ -214,9 +214,9 @@ const ContentListView: FunctionComponent<Props> = ({
const panelResizeFinishCallback: ResizeFinishCallback = useCallback(
(width, _lastLeft, _isMaxWidth, isCollapsed) => {
if (selectedAsTag) {
navigationController.setPanelWidthForTag(selectedAsTag, width)
void navigationController.setPanelWidthForTag(selectedAsTag, width)
} else {
application.setPreference(PrefKey.NotesPanelWidth, width).catch(console.error)
void application.setPreference(PrefKey.NotesPanelWidth, width).catch(console.error)
}
application.publishPanelDidResizeEvent(PANEL_NAME_NOTES, isCollapsed)
},

View File

@@ -113,7 +113,7 @@ const DailyContentList: FunctionComponent<Props> = ({
const onClickTemplate = useCallback(
(date: Date) => {
setSelectedDay(date)
itemListController.createNewNote(undefined, date, 'editor')
void itemListController.createNewNote(undefined, date, 'editor')
toggleAppPane(AppPaneId.Editor)
},
[setSelectedDay, itemListController, toggleAppPane],

View File

@@ -101,7 +101,7 @@ const DisplayOptionsMenu: FunctionComponent<DisplayOptionsMenuProps> = ({
)
const resetTagPreferences = useCallback(() => {
application.mutator.changeAndSaveItem<TagMutator>(selectedTag, (mutator) => {
void application.mutator.changeAndSaveItem<TagMutator>(selectedTag, (mutator) => {
mutator.preferences = undefined
})
}, [application, selectedTag])

View File

@@ -101,7 +101,7 @@ const NewNotePreferences: FunctionComponent<Props> = ({
const setNewNoteTitleFormatChange = (value: string) => {
setNewNoteTitleFormat(value as NewNoteTitleFormat)
if (mode === 'global') {
application.setPreference(PrefKey.NewNoteTitleFormat, value as NewNoteTitleFormat)
void application.setPreference(PrefKey.NewNoteTitleFormat, value as NewNoteTitleFormat)
} else {
void changePreferencesCallback({ newNoteTitleFormat: value as NewNoteTitleFormat })
}
@@ -168,7 +168,7 @@ const NewNotePreferences: FunctionComponent<Props> = ({
if (mode === 'tag') {
void changePreferencesCallback({ customNoteTitleFormat: newFormat })
} else {
application.setPreference(PrefKey.CustomNoteTitleFormat, newFormat)
void application.setPreference(PrefKey.CustomNoteTitleFormat, newFormat)
}
}, PrefChangeDebounceTimeInMs)
}

View File

@@ -50,7 +50,7 @@ const PreviewComponent: FunctionComponent<Props> = ({ application, file, bytes }
}),
)
application.mobileDevice().previewFile(fileBase64, file.name)
void application.mobileDevice().previewFile(fileBase64, file.name)
}, [application, bytes, file.mimeType, file.name, isNativeMobileWeb])
useEffect(() => {

View File

@@ -61,14 +61,14 @@ const LinkedItemBubble = ({
const onUnlinkClick: MouseEventHandler = (event) => {
event.stopPropagation()
unlinkItem(link)
void unlinkItem(link)
}
const onKeyDown: KeyboardEventHandler = (event) => {
switch (event.key) {
case KeyboardKey.Backspace: {
focusPreviousItem()
unlinkItem(link)
void unlinkItem(link)
break
}
case KeyboardKey.Left:

View File

@@ -43,7 +43,7 @@ const LinkedItemSearchResults = ({
if (cannotLinkItem) {
premiumModal.activate('Note linking')
} else {
linkItemToSelectedItem(result)
void linkItemToSelectedItem(result)
onClickCallback?.()
}
}}
@@ -62,7 +62,7 @@ const LinkedItemSearchResults = ({
<button
className="group flex w-full items-center gap-2 overflow-hidden py-2 px-3 hover:bg-contrast hover:text-foreground focus:bg-info-backdrop"
onClick={() => {
createAndAddNewTag(searchQuery)
void createAndAddNewTag(searchQuery)
onClickCallback?.()
}}
>

View File

@@ -206,7 +206,7 @@ const LinkedItemsPanel = ({
}
for (let i = 0; i < files.length; i++) {
filesController.uploadNewFile(files[i]).then((uploadedFiles) => {
void filesController.uploadNewFile(files[i]).then((uploadedFiles) => {
if (uploadedFiles) {
void linkItemToSelectedItem(uploadedFiles[0])
}

View File

@@ -392,7 +392,7 @@ const NotesOptions = ({
<button
className={defaultClassNames}
onClick={() => {
application.isNativeMobileWeb() ? shareSelectedNotes(application, notes) : downloadSelectedItems()
application.isNativeMobileWeb() ? void shareSelectedNotes(application, notes) : void downloadSelectedItems()
}}
>
<Icon type={application.platform === Platform.Android ? 'share' : 'download'} className={iconClass} />

View File

@@ -12,7 +12,7 @@ type Props = {
const SubscriptionInformation = ({ subscriptionState, application }: Props) => {
const manageSubscription = async () => {
openSubscriptionDashboard(application)
void openSubscriptionDashboard(application)
}
return (

View File

@@ -78,12 +78,12 @@ const DataBackups = ({ application, viewControllerManager }: Props) => {
.getArchiveService()
.formattedDateForExports()}`
const sanitizedFilename = sanitizeFileName(filename) + '.txt'
downloadOrShareBlobBasedOnPlatform(application, blobData, sanitizedFilename)
void downloadOrShareBlobBasedOnPlatform(application, blobData, sanitizedFilename)
} else {
const zippedDecryptedItemsBlob = await application.getArchiveService().getZippedDecryptedItemsBlob(data)
const filename = `Standard Notes Backup - ${application.getArchiveService().formattedDateForExports()}`
const sanitizedFilename = sanitizeFileName(filename) + '.zip'
downloadOrShareBlobBasedOnPlatform(application, zippedDecryptedItemsBlob, sanitizedFilename)
void downloadOrShareBlobBasedOnPlatform(application, zippedDecryptedItemsBlob, sanitizedFilename)
}
}

View File

@@ -29,7 +29,7 @@ const PlaintextDefaults = ({ application }: Props) => {
const handleLineHeightChange = (value: string) => {
setLineHeight(value as EditorLineHeight)
application.setPreference(PrefKey.EditorLineHeight, value as EditorLineHeight)
void application.setPreference(PrefKey.EditorLineHeight, value as EditorLineHeight)
}
const lineHeightDropdownOptions = useMemo(
@@ -47,7 +47,7 @@ const PlaintextDefaults = ({ application }: Props) => {
const handleFontSizeChange = (value: string) => {
setFontSize(value as EditorFontSize)
application.setPreference(PrefKey.EditorFontSize, value as EditorFontSize)
void application.setPreference(PrefKey.EditorFontSize, value as EditorFontSize)
}
const fontSizeDropdownOptions = useMemo(

View File

@@ -27,7 +27,7 @@ const PremiumFeaturesModal: FunctionComponent<Props> = ({
const handleClick = useCallback(() => {
if (hasSubscription) {
openSubscriptionDashboard(application)
void openSubscriptionDashboard(application)
} else if (hasAccount) {
void loadPurchaseFlowUrl(application)
} else if (window.plansUrl) {

View File

@@ -164,7 +164,7 @@ const QuickSettingsMenu: FunctionComponent<MenuProps> = ({ application, quickSet
const toggleDefaultTheme = useCallback(() => {
deactivateAnyNonLayerableTheme()
application.setPreference(PrefKey.DarkMode, false)
void application.setPreference(PrefKey.DarkMode, false)
}, [application, deactivateAnyNonLayerableTheme])
return (

View File

@@ -18,7 +18,7 @@ const HistoryModalFooter = ({ dismissModal, noteHistoryController }: Props) => {
const restoreSelectedRevision = useCallback(() => {
if (selectedRevision) {
restoreRevision(selectedRevision)
void restoreRevision(selectedRevision)
dismissModal()
}
}, [dismissModal, restoreRevision, selectedRevision])

View File

@@ -33,7 +33,7 @@ const LegacyHistoryList: FunctionComponent<Props> = ({ legacyHistory, noteHistor
key={url}
isSelected={selectedEntryUrl === url}
onClick={() => {
selectLegacyRevision(entry)
void selectLegacyRevision(entry)
onSelectRevision()
}}
>

View File

@@ -48,7 +48,7 @@ const RemoteHistoryList: FunctionComponent<RemoteHistoryListProps> = ({
key={entry.uuid}
isSelected={(selectedEntry as RevisionListEntry)?.uuid === entry.uuid}
onClick={() => {
selectRemoteRevision(entry)
void selectRemoteRevision(entry)
onSelectRevision()
}}
>