From 8b3b026aeaa67c4784054e15c16015d731542320 Mon Sep 17 00:00:00 2001 From: Klemek Date: Wed, 5 Nov 2025 09:11:59 +0100 Subject: [PATCH] refactor: use separate seed for reroll of vegetables --- eslint.config.mjs | 1 + index.html | 6 +++--- main.js | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index be5f17b..a895263 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -25,6 +25,7 @@ export default [ "max-statements": ["warn", 50], "max-params": ["warn", 5], "max-lines": "off", + "init-declarations": "off", }, }, { diff --git a/index.html b/index.html index 61c3733..21229e3 100644 --- a/index.html +++ b/index.html @@ -75,8 +75,8 @@ - -
+ +
{{candidates.length}} @@ -124,4 +124,4 @@ - + \ No newline at end of file diff --git a/main.js b/main.js index 5551ed4..a9cc47f 100644 --- a/main.js +++ b/main.js @@ -103,6 +103,7 @@ class TableGenerator { return scores; } + // eslint-disable-next-line class-methods-use-this mixKey(index1, index2) { return Math.min(index1, index2) * 1000 + Math.max(index1, index2); } @@ -312,7 +313,7 @@ const app = createApp({ }, newVegetables() { this.config.candidates = utils - .shuffleSeeded(Object.keys(VEGETABLES), this.config.seed) + .shuffleSeeded(Object.keys(VEGETABLES), utils.randomSeed()) .map((key) => `${key} ${VEGETABLES[key]}`) .slice(0, 6) .join("\n"); @@ -374,8 +375,7 @@ const app = createApp({ try { await navigator.clipboard.writeText(csvTable); this.copyTableOverride = "Table Copied"; - } catch (error) { - console.error(error.message); + } catch { this.copyTableOverride = "Error"; } setTimeout(() => {