fix(settings): check selection default value in the settings validator

This commit is contained in:
2026-06-04 15:24:30 +02:00
parent 12f67f17ed
commit 8ff26f4bb8
@@ -72,6 +72,14 @@ export const validateEntry = function validateEntry (entry, path) {
if (entry.type === 'string' && typeof entry.default !== 'string') { if (entry.type === 'string' && typeof entry.default !== 'string') {
throw new Error(`[settings] "${path}.default" must be a string`); throw new Error(`[settings] "${path}.default" must be a string`);
} }
if (entry.type === 'selection') {
if (typeof entry.default !== 'string') {
throw new Error(`[settings] "${path}.default" must be a string`);
};
if (!entry.options.map((option) => option.name).includes(entry.default)) {
throw new Error(`[settings] option "${path}.default" does not exist`);
};
};
} }
} }