diff --git a/.eslintrc.json b/.eslintrc.json index 03be593b..bfaf7e2b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -104,7 +104,6 @@ "@typescript-eslint/ban-types": "off", "no-shadow": "off", "@typescript-eslint/no-shadow": ["error"], - "@typescript-eslint/no-floating-promises": "off", "@typescript-eslint/no-misused-promises": "off", "@typescript-eslint/no-unnecessary-type-assertion": "off", "@typescript-eslint/no-unsafe-assignment": "off", diff --git a/app/commands.ts b/app/commands.ts index 0ee59668..e285b163 100644 --- a/app/commands.ts +++ b/app/commands.ts @@ -26,7 +26,7 @@ const commands: Record void> = { focusedWindow?.rpc.emit('termgroup close req'); }, 'window:preferences': () => { - openConfig(); + void openConfig(); }, 'editor:clearBuffer': (focusedWindow) => { focusedWindow?.rpc.emit('session clear req'); @@ -118,7 +118,7 @@ const commands: Record void> = { focusedWindow?.rpc.emit('session search close'); }, 'cli:install': () => { - installCLI(true); + void installCLI(true); }, 'window:hamburgerMenu': () => { if (process.platform !== 'darwin' && ['', true].includes(getConfig().showHamburgerMenu)) { diff --git a/app/config.ts b/app/config.ts index 564b96ae..6f8919dd 100644 --- a/app/config.ts +++ b/app/config.ts @@ -59,9 +59,14 @@ const _watch = () => { app.on('before-quit', (e) => { if (Object.keys(_watcher.getWatched()).length > 0) { e.preventDefault(); - _watcher.close().then(() => { - app.quit(); - }); + _watcher + .close() + .catch((err) => { + console.warn(err); + }) + .finally(() => { + app.quit(); + }); } }); }; diff --git a/app/index.ts b/app/index.ts index d0317864..f9b2e7ad 100644 --- a/app/index.ts +++ b/app/index.ts @@ -127,7 +127,7 @@ app.on('ready', () => const hwin = newWindow({width, height, x: startX, y: startY}, cfg, fn); windowSet.add(hwin); - hwin.loadURL(url); + void hwin.loadURL(url); // the window can be closed by the browser process itself hwin.on('close', () => { @@ -191,7 +191,7 @@ app.on('ready', () => console.log('Removing Hyper from default client for ssh:// protocol'); app.removeAsDefaultProtocolClient('ssh'); } - installCLI(false); + void installCLI(false); } }) .catch((err) => { diff --git a/app/menus/menu.ts b/app/menus/menu.ts index a924f15e..47c5fc47 100644 --- a/app/menus/menu.ts +++ b/app/menus/menu.ts @@ -51,7 +51,7 @@ export const createMenu = ( .map(([type, count]) => type + (count > 1 ? ` (${count})` : '')) .join(', '); - dialog.showMessageBox({ + void dialog.showMessageBox({ title: `About ${appName}`, message: `${appName} ${appVersion} (${updateChannel})`, detail: `Renderers: ${renderers}\nPlugins: ${pluginList}\n\nCreated by Guillermo Rauch\nCopyright © 2020 Vercel, Inc.`, diff --git a/app/menus/menus/help.ts b/app/menus/menus/help.ts index f06e2145..c0d95644 100644 --- a/app/menus/menus/help.ts +++ b/app/menus/menus/help.ts @@ -9,7 +9,7 @@ export default (commands: Record, showAbout: () => void): MenuIt { label: `${app.name} Website`, click() { - shell.openExternal('https://hyper.is'); + void shell.openExternal('https://hyper.is'); } }, { @@ -60,7 +60,7 @@ ${JSON.stringify(getPlugins(), null, 2)} const issueURL = `https://github.com/vercel/hyper/issues/new?body=${encodeURIComponent(body)}`; const copyAndSend = () => { clipboard.writeText(body); - shell.openExternal( + void shell.openExternal( `https://github.com/vercel/hyper/issues/new?body=${encodeURIComponent( '\n' @@ -70,7 +70,7 @@ ${JSON.stringify(getPlugins(), null, 2)} if (!focusedWindow) { copyAndSend(); } else if (issueURL.length > 6144) { - dialog + void dialog .showMessageBox(focusedWindow, { message: 'There is too much data to send to GitHub directly. The data will be copied to the clipboard, ' + @@ -84,7 +84,7 @@ ${JSON.stringify(getPlugins(), null, 2)} } }); } else { - shell.openExternal(issueURL); + void shell.openExternal(issueURL); } } } diff --git a/app/plugins.ts b/app/plugins.ts index 67ea13ea..514f0685 100644 --- a/app/plugins.ts +++ b/app/plugins.ts @@ -213,7 +213,7 @@ function syncPackageJSON() { } function alert(message: string) { - dialog.showMessageBox({ + void dialog.showMessageBox({ message, buttons: ['Ok'] }); diff --git a/app/ui/window.ts b/app/ui/window.ts index 3eeb0cf3..f9cdf857 100644 --- a/app/ui/window.ts +++ b/app/ui/window.ts @@ -206,7 +206,7 @@ export function newWindow( setRendererType(uid, type); }); rpc.on('open external', ({url}) => { - shell.openExternal(url); + void shell.openExternal(url); }); rpc.on('open context menu', (selection) => { const {createWindow} = app; @@ -277,7 +277,7 @@ export function newWindow( const protocol = typeof url === 'string' && parseUrl(url).protocol; if (protocol === 'http:' || protocol === 'https:') { event.preventDefault(); - shell.openExternal(url); + void shell.openExternal(url); } }); diff --git a/app/updater.ts b/app/updater.ts index e0f55fbc..5b50665f 100644 --- a/app/updater.ts +++ b/app/updater.ts @@ -61,7 +61,7 @@ async function init() { export default (win: BrowserWindow) => { if (!isInit) { - init(); + void init(); } const {rpc} = win; diff --git a/cli/index.ts b/cli/index.ts index f329a7d2..b0158b7c 100644 --- a/cli/index.ts +++ b/cli/index.ts @@ -157,7 +157,7 @@ args.command( (name, args_) => { const pluginName = args_[0]; assertPluginName(pluginName); - open(`http://ghub.io/${pluginName}`, {wait: false}); + void open(`http://ghub.io/${pluginName}`, {wait: false}); process.exit(0); }, ['d', 'h', 'home'] diff --git a/lib/components/notifications.tsx b/lib/components/notifications.tsx index 1456f7bf..4a7b00bd 100644 --- a/lib/components/notifications.tsx +++ b/lib/components/notifications.tsx @@ -51,7 +51,7 @@ export default class Notifications extends React.PureComponent { - window.require('electron').shell.openExternal(ev.currentTarget.href); + void window.require('electron').shell.openExternal(ev.currentTarget.href); ev.preventDefault(); }} href={this.props.messageURL} @@ -78,7 +78,7 @@ export default class Notifications extends React.PureComponent { - window.require('electron').shell.openExternal(ev.currentTarget.href); + void window.require('electron').shell.openExternal(ev.currentTarget.href); ev.preventDefault(); }} href={`https://github.com/vercel/hyper/releases/tag/${this.props.updateVersion}`} @@ -106,7 +106,7 @@ export default class Notifications extends React.PureComponent { - window.require('electron').shell.openExternal(ev.currentTarget.href); + void window.require('electron').shell.openExternal(ev.currentTarget.href); ev.preventDefault(); }} href={this.props.updateReleaseUrl!} diff --git a/lib/components/term.tsx b/lib/components/term.tsx index 5e48570f..55174917 100644 --- a/lib/components/term.tsx +++ b/lib/components/term.tsx @@ -158,7 +158,7 @@ export default class Term extends React.PureComponent { this.term.loadAddon( new WebLinksAddon( (event: MouseEvent | undefined, uri: string) => { - if (shallActivateWebLink(event)) shell.openExternal(uri); + if (shallActivateWebLink(event)) void shell.openExternal(uri); }, { // prevent default electron link handling to allow selection, e.g. via double-click diff --git a/lib/index.tsx b/lib/index.tsx index 26d6192a..5d31ef04 100644 --- a/lib/index.tsx +++ b/lib/index.tsx @@ -39,7 +39,7 @@ const fetchFileData = (configData: configOptions) => { return; } - getBase64FileData(configInfo.bellSoundURL).then((base64FileData) => { + void getBase64FileData(configInfo.bellSoundURL).then((base64FileData) => { // prepend "base64," to the result of this method in order for this to work properly within xterm.js const bellSound = !base64FileData ? null : 'base64,' + base64FileData; configInfo.bellSound = bellSound;