mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-26 12:55:16 -07:00
style: format config settings changes
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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.',
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -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]));
|
||||
|
||||
|
||||
@@ -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',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user