From 3b1b17ebf1e319858aec98dead3888441a477b09 Mon Sep 17 00:00:00 2001 From: poli0981 <127664709+poli0981@users.noreply.github.com> Date: Tue, 17 Nov 2026 10:38:59 +0700 Subject: [PATCH] fix(qodana): clear the first run's findings The first Qodana run found 74 problems in TypeScript / JavaScript and 12 in Rust. Fixed: - React 19.3 deprecates `FormEvent`: the three save forms take the `SubmitEvent` their `onSubmit` hands them. - The URL patterns read `\S` instead of `[^\s]` (18 patterns in platforms.ts and playtest-platforms.ts, same characters). - public/theme-init.js declares its browser globals and drops an unused catch binding. - The two private `stable()` JSON helpers (restore.ts, library-apply.ts) become one `stableJson()` in src/utils/stable-json.ts, with a test. - vitest.config.ts reuses vite.config.ts's alias map instead of a copy. - Accordion destructures `icon` as `Icon` instead of copying it, a JSDoc link points at nothing any more, and i18next's `init()` promise is `void`ed on purpose. - Rust: the three "show the main window" blocks become `show_main_window`. Excluded in qodana.yaml, each with its reason: the Discord webhook secret reference (HardcodedPasswords), escaped `]` / `}` in regexes, the `@i18n/index` imports tsconfig needs, the three react-hooks warnings eslint.config.js documents, the legacy `@deprecated` draft fields in the files that migrate them; in src-tauri/qodana.yaml the module paths `generate_handler!` needs. Co-Authored-By: Claude Opus 5.5 --- public/theme-init.js | 3 +- qodana.yaml | 35 +++++++++++++++++++ src-tauri/qodana.yaml | 7 ++++ src-tauri/src/lib.rs | 32 ++++++++--------- src/components/presets/PresetSaveForm.tsx | 4 +-- src/components/profiles/ProfileSaveForm.tsx | 4 +-- src/components/templates/TemplateSaveForm.tsx | 4 +-- src/components/ui/Accordion.tsx | 4 +-- src/config/platforms.ts | 28 +++++++-------- src/config/playtest-platforms.ts | 8 ++--- src/engine/types.ts | 2 +- src/i18n/index.ts | 4 ++- src/utils/backup/restore.ts | 20 ++++------- src/utils/library-apply.ts | 18 +++------- src/utils/stable-json.ts | 15 ++++++++ tests/utils/stable-json.test.ts | 17 +++++++++ vite.config.ts | 27 +++++++------- vitest.config.ts | 20 ++--------- 18 files changed, 147 insertions(+), 105 deletions(-) create mode 100644 src/utils/stable-json.ts create mode 100644 tests/utils/stable-json.test.ts diff --git a/public/theme-init.js b/public/theme-init.js index 5fd1b6c..06b444d 100644 --- a/public/theme-init.js +++ b/public/theme-init.js @@ -2,6 +2,7 @@ // first paint, so a light-theme user never sees the dark default flash. A // separate file rather than an inline