From 58f5fff6ad5eae9c43df153f28e65187a623e59d Mon Sep 17 00:00:00 2001 From: sudacode Date: Sun, 17 May 2026 02:41:17 -0700 Subject: [PATCH] style: format config settings changes --- src/config/resolve/subtitle-domains.ts | 4 +--- src/config/resolve/subtitle-style.test.ts | 3 +-- src/config/settings/registry.ts | 8 +------- src/settings/settings-control-dom.ts | 6 +++--- src/settings/settings.ts | 4 +++- src/types/settings.ts | 5 +---- 6 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/config/resolve/subtitle-domains.ts b/src/config/resolve/subtitle-domains.ts index bd18a8f7..fdf80964 100644 --- a/src/config/resolve/subtitle-domains.ts +++ b/src/config/resolve/subtitle-domains.ts @@ -350,9 +350,7 @@ export function applySubtitleDomainConfig(context: ResolveContext): void { ); } - const nPlusOneColor = asColor( - (src.subtitleStyle as { nPlusOneColor?: unknown }).nPlusOneColor, - ); + const nPlusOneColor = asColor((src.subtitleStyle as { nPlusOneColor?: unknown }).nPlusOneColor); if (nPlusOneColor !== undefined) { resolved.subtitleStyle.nPlusOneColor = nPlusOneColor; } else if ((src.subtitleStyle as { nPlusOneColor?: unknown }).nPlusOneColor !== undefined) { diff --git a/src/config/resolve/subtitle-style.test.ts b/src/config/resolve/subtitle-style.test.ts index b2522642..37368ea8 100644 --- a/src/config/resolve/subtitle-style.test.ts +++ b/src/config/resolve/subtitle-style.test.ts @@ -199,8 +199,7 @@ test('subtitleStyle nPlusOneColor accepts valid values and warns on invalid', () assert.ok( invalid.warnings.some( (warning) => - warning.path === 'subtitleStyle.nPlusOneColor' && - warning.message === 'Expected hex color.', + warning.path === 'subtitleStyle.nPlusOneColor' && warning.message === 'Expected hex color.', ), ); }); diff --git a/src/config/settings/registry.ts b/src/config/settings/registry.ts index 27da69d7..5f3ca3e5 100644 --- a/src/config/settings/registry.ts +++ b/src/config/settings/registry.ts @@ -80,13 +80,7 @@ const JSON_OBJECT_FIELDS = new Set([ const SECRET_PATHS = new Set(['ai.apiKey', 'jimaku.apiKey', 'anilist.accessToken']); -const COLOR_SUFFIXES = new Set([ - 'Color', - 'color', - 'backgroundColor', - 'singleColor', - 'nPlusOne', -]); +const COLOR_SUFFIXES = new Set(['Color', 'color', 'backgroundColor', 'singleColor', 'nPlusOne']); const OPTION_BY_PATH = new Map(CONFIG_OPTION_REGISTRY.map((entry) => [entry.path, entry])); diff --git a/src/settings/settings-control-dom.ts b/src/settings/settings-control-dom.ts index e62c25be..d4bf0daf 100644 --- a/src/settings/settings-control-dom.ts +++ b/src/settings/settings-control-dom.ts @@ -27,8 +27,8 @@ export function isSecretSnapshotValue( ): value is { configured: boolean } { return Boolean( value && - typeof value === 'object' && - 'configured' in value && - typeof (value as { configured?: unknown }).configured === 'boolean', + typeof value === 'object' && + 'configured' in value && + typeof (value as { configured?: unknown }).configured === 'boolean', ); } diff --git a/src/settings/settings.ts b/src/settings/settings.ts index f586b16a..e104b3c1 100644 --- a/src/settings/settings.ts +++ b/src/settings/settings.ts @@ -221,7 +221,9 @@ function renderField(field: ConfigSettingsField): HTMLElement { header.append(label, description, createFieldMeta(field)); const controlWrap = createElement('div', 'field-control'); - controlWrap.append(renderControl(field, { setFieldError, updateDraft, valueForField, valueForPath })); + controlWrap.append( + renderControl(field, { setFieldError, updateDraft, valueForField, valueForPath }), + ); const resetButton = createElement('button', 'reset-button') as HTMLButtonElement; resetButton.type = 'button'; resetButton.textContent = 'Reset'; diff --git a/src/types/settings.ts b/src/types/settings.ts index e1f6e51b..39a2b4d4 100644 --- a/src/types/settings.ts +++ b/src/types/settings.ts @@ -87,10 +87,7 @@ export interface ConfigSettingsAPI { openSettingsFile(): Promise; openSettingsWindow(): Promise; getAnkiDeckNames(draftUrl?: string): Promise; - getAnkiDeckFieldNames( - deckName: string, - draftUrl?: string, - ): Promise; + getAnkiDeckFieldNames(deckName: string, draftUrl?: string): Promise; getAnkiModelNames(draftUrl?: string): Promise; getAnkiModelFieldNames( modelName: string,