From eb201de26be2a4cef011b024e48f4439385a43de Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Thu, 21 May 2026 22:00:52 +0000 Subject: [PATCH] add prefer-const to eslint rules, remove empty block in dialog --- dev_config/eslint.config.mjs | 3 ++- web/scripts/dialog.js | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev_config/eslint.config.mjs b/dev_config/eslint.config.mjs index b5522eb..cc7db54 100644 --- a/dev_config/eslint.config.mjs +++ b/dev_config/eslint.config.mjs @@ -23,6 +23,7 @@ export default defineConfig([js.configs.recommended,{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_", "caughtErrorsIgnorePattern": "^_" - }] + }], + "prefer-const": ["error"] }, }]); \ No newline at end of file diff --git a/web/scripts/dialog.js b/web/scripts/dialog.js index 5209059..24660c5 100644 --- a/web/scripts/dialog.js +++ b/web/scripts/dialog.js @@ -113,8 +113,7 @@ class ErrorDialog extends HTMLElement { } this.dialog.addEventListener("close", () => { - if (this.dialog.returnValue === "ok") {} - else if (this.dialog.returnValue === "copy") { + if (this.dialog.returnValue === "copy") { let errors = ""; for (const error of this.errors.childNodes) { errors += `${error.innerText}\n`;