diff options
author | Wolfgang Müller | 2025-01-27 17:47:42 +0100 |
---|---|---|
committer | Wolfgang Müller | 2025-01-27 17:47:42 +0100 |
commit | 749062bed65a0f740988399ae591d259c71fdc3b (patch) | |
tree | 47e7e177e083f75bcc8b2f1cb3eeb916f7e2f73e /frontend/src/lib | |
parent | 2099fb6e90c9ea3ef769cc3373ed98b61285d393 (diff) | |
download | hircine-749062bed65a0f740988399ae591d259c71fdc3b.tar.gz |
frontend/lint: Fix miscellaneous lint issues
Diffstat (limited to 'frontend/src/lib')
-rw-r--r-- | frontend/src/lib/Filter.ts | 4 | ||||
-rw-r--r-- | frontend/src/lib/Navigation.ts | 2 | ||||
-rw-r--r-- | frontend/src/lib/Shortcuts.ts | 2 | ||||
-rw-r--r-- | frontend/src/lib/Update.ts | 4 |
4 files changed, 4 insertions, 8 deletions
diff --git a/frontend/src/lib/Filter.ts b/frontend/src/lib/Filter.ts index 8e419f3..1340eaf 100644 --- a/frontend/src/lib/Filter.ts +++ b/frontend/src/lib/Filter.ts @@ -25,9 +25,7 @@ type FilterMode = 'any' | 'all' | 'exact'; type Key = string | number | symbol; -type Filter<T, K extends Key> = { - [Property in K]?: T | null; -}; +type Filter<T, K extends Key> = Partial<Record<K, T | null>>; type AssocFilter<T, K extends Key> = Filter< { diff --git a/frontend/src/lib/Navigation.ts b/frontend/src/lib/Navigation.ts index e6b17cd..5ed3ec5 100644 --- a/frontend/src/lib/Navigation.ts +++ b/frontend/src/lib/Navigation.ts @@ -41,7 +41,7 @@ export function parseFilter<T>(params: URLSearchParams): T { try { return JsonURL.parse(param, { AQF: true, impliedObject: {} }) as T; - } catch (e) { + } catch { return {} as T; } } diff --git a/frontend/src/lib/Shortcuts.ts b/frontend/src/lib/Shortcuts.ts index 063bd40..300ddcb 100644 --- a/frontend/src/lib/Shortcuts.ts +++ b/frontend/src/lib/Shortcuts.ts @@ -37,7 +37,7 @@ type ModeSwitch = (typeof modeSwitches)[number]; function isModeSwitch(s: string): s is ModeSwitch { // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument - return modeSwitches.indexOf(s as any) !== -1; + return modeSwitches.includes(s as any); } type Key = Letter | Special; diff --git a/frontend/src/lib/Update.ts b/frontend/src/lib/Update.ts index 507dd52..13aec61 100644 --- a/frontend/src/lib/Update.ts +++ b/frontend/src/lib/Update.ts @@ -12,9 +12,7 @@ interface AssociationUpdate { options?: UpdateOptions | null; } -type Input<T, K extends Key> = { - [Property in K]?: T | null; -}; +type Input<T, K extends Key> = Partial<Record<K, T | null>>; abstract class Entry<K extends Key> { key: K; |