style: format config settings changes

This commit is contained in:
2026-05-17 02:41:17 -07:00
parent 309ce6ef8f
commit 58f5fff6ad
6 changed files with 10 additions and 20 deletions
+1 -3
View File
@@ -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) {
+1 -2
View File
@@ -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.',
),
);
});
+1 -7
View File
@@ -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]));
+3 -3
View File
@@ -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',
);
}
+3 -1
View File
@@ -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';
+1 -4
View File
@@ -87,10 +87,7 @@ export interface ConfigSettingsAPI {
openSettingsFile(): Promise<boolean>;
openSettingsWindow(): Promise<boolean>;
getAnkiDeckNames(draftUrl?: string): Promise<ConfigSettingsAnkiListResult>;
getAnkiDeckFieldNames(
deckName: string,
draftUrl?: string,
): Promise<ConfigSettingsAnkiListResult>;
getAnkiDeckFieldNames(deckName: string, draftUrl?: string): Promise<ConfigSettingsAnkiListResult>;
getAnkiModelNames(draftUrl?: string): Promise<ConfigSettingsAnkiListResult>;
getAnkiModelFieldNames(
modelName: string,