From 008989dc83ef6e5dd3dfb5a249d752ed4eff8e79 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Tue, 1 Jul 2025 16:37:54 +0100 Subject: [PATCH] lint fixes --- index.js | 7 ++++--- utils/clip.js | 10 +++------- utils/screenshot.js | 12 ++++-------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/index.js b/index.js index 15ac0cc..40a8b93 100755 --- a/index.js +++ b/index.js @@ -21,9 +21,9 @@ const socket = new WebSocket(`ws://${address}:${port}`) /** * Print help information. - * @param {string} helpText + * @param {string} helpText */ -function printHelp(helpText) { +function printHelp (helpText) { console.log(helpText) process.exit(0) } @@ -33,7 +33,8 @@ function printHelp(helpText) { * @param {WebSocket} socket - The websocket instance. * @param {function} fn - The function to execute with the channel. */ -function withChannel(socket, fn) { +function withChannel (socket, fn) { + // eslint-disable-next-line no-new new QWebChannel(socket, function (channel) { fn(channel) .then((result) => { diff --git a/utils/clip.js b/utils/clip.js index 9205e91..26c4195 100644 --- a/utils/clip.js +++ b/utils/clip.js @@ -18,13 +18,9 @@ const clipHelp = meowHelp({ defaults: false }) -async function saveClip(channel) { - try { - await channel.objects.meld.sendCommand('meld.recordClip'); - return 'Clip command sent successfully.'; - } catch (err) { - throw err; - } +async function saveClip (channel) { + await channel.objects.meld.sendCommand('meld.recordClip') + return 'Clip command sent successfully.' } export { clipHelp, saveClip } diff --git a/utils/screenshot.js b/utils/screenshot.js index d8b0b7e..b3dadc4 100644 --- a/utils/screenshot.js +++ b/utils/screenshot.js @@ -18,13 +18,9 @@ const screenshotHelp = meowHelp({ defaults: false }) -async function takeScreenshot(channel) { - try { - await channel.objects.meld.sendCommand('meld.screenshot'); - return 'Screenshot command sent successfully.'; - } catch (err) { - throw err; - } +async function takeScreenshot (channel) { + await channel.objects.meld.sendCommand('meld.screenshot') + return 'Screenshot command sent successfully.' } -export { screenshotHelp, takeScreenshot } \ No newline at end of file +export { screenshotHelp, takeScreenshot }