From 2bd6efa503793df56785d33252ed444038ee6151 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sun, 25 Jan 2026 23:20:57 +0100 Subject: [PATCH] UI: Enforce snake case for functions It's more common to write functions in camelCase in JS, so some people started doing it, including me. But the majority of the codebase is snake_case, so let's enforce that. --- daemon/web/eslint.config.js | 11 +++++++++++ .../web/src/lib/components/ApiRequestButton.svelte | 4 ++-- daemon/web/src/lib/components/ConfigForm.svelte | 12 ++++++------ daemon/web/src/lib/components/DeleteButton.svelte | 4 ++-- daemon/web/src/lib/components/ReAnalyzeButton.svelte | 4 ++-- daemon/web/src/lib/stores/breakpoint.ts | 10 +++++----- 6 files changed, 28 insertions(+), 17 deletions(-) diff --git a/daemon/web/eslint.config.js b/daemon/web/eslint.config.js index 1ef0f52..b19dc75 100644 --- a/daemon/web/eslint.config.js +++ b/daemon/web/eslint.config.js @@ -37,6 +37,17 @@ export default ts.config( { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }, ], '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/naming-convention': [ + 'error', + { + selector: 'function', + format: ['snake_case'], + }, + { + selector: 'method', + format: ['snake_case'], + }, + ], }, } ); diff --git a/daemon/web/src/lib/components/ApiRequestButton.svelte b/daemon/web/src/lib/components/ApiRequestButton.svelte index b43b60c..c7d683f 100644 --- a/daemon/web/src/lib/components/ApiRequestButton.svelte +++ b/daemon/web/src/lib/components/ApiRequestButton.svelte @@ -43,7 +43,7 @@ }, }; - async function handleClick() { + async function handle_click() { if (is_disabled) return; is_requesting = true; @@ -71,7 +71,7 @@