diff --git a/Models/ThemeConfig/Conversion/Validation.ts b/Models/ThemeConfig/Conversion/Validation.ts index 06ae6f585..5e5a92d34 100644 --- a/Models/ThemeConfig/Conversion/Validation.ts +++ b/Models/ThemeConfig/Conversion/Validation.ts @@ -593,8 +593,10 @@ export class DetectMappingsWithImages extends DesugaringStep { - constructor() { - super("Miscellanious checks on the tagrendering", ["special"], "MiscTagRenderingChecks") + private _options: { noQuestionHintCheck: boolean } + constructor(options: { noQuestionHintCheck: boolean }) { + super("Miscellaneous checks on the tagrendering", ["special"], "MiscTagRenderingChecks") + this._options = options } convert( @@ -615,7 +617,7 @@ class MiscTagRenderingChecks extends DesugaringStep { ': detected `special` on the top level. Did you mean `{"render":{ "special": ... }}`' ) } - if (json["question"]) { + if (json["question"] && !this._options?.noQuestionHintCheck) { const question = Translations.T( new TypedTranslation(json["question"]), context + ".question" @@ -644,12 +646,16 @@ class MiscTagRenderingChecks extends DesugaringStep { } export class ValidateTagRenderings extends Fuse { - constructor(layerConfig?: LayerConfigJson, doesImageExist?: DoesImageExist) { + constructor( + layerConfig?: LayerConfigJson, + doesImageExist?: DoesImageExist, + options?: { noQuestionHintCheck: boolean } + ) { super( "Various validation on tagRenderingConfigs", new DetectShadowedMappings(layerConfig), new DetectMappingsWithImages(doesImageExist), - new MiscTagRenderingChecks() + new MiscTagRenderingChecks(options) ) } } @@ -835,7 +841,11 @@ export class ValidateLayer extends DesugaringStep { if (json.tagRenderings !== undefined) { const r = new On( "tagRenderings", - new Each(new ValidateTagRenderings(json, this._doesImageExist)) + new Each( + new ValidateTagRenderings(json, this._doesImageExist, { + noQuestionHintCheck: json["#"]?.indexOf("no-question-hint-check") >= 0, + }) + ) ).convert(json, context) warnings.push(...(r.warnings ?? [])) errors.push(...(r.errors ?? []))