More checks

This commit is contained in:
Pieter Vander Vennet 2022-02-19 17:39:16 +01:00
parent dcfac434e2
commit 55f9ee605f
2 changed files with 31 additions and 5 deletions

View file

@ -208,11 +208,29 @@ class OverrideShadowingCheck extends DesugaringStep<LayoutConfigJson> {
}
class MiscThemeChecks extends DesugaringStep<LayoutConfigJson>{
constructor() {
super("Miscelleanous checks on the theme", [],"MiscThemesChecks");
}
convert(json: LayoutConfigJson, context: string): { result: LayoutConfigJson; errors?: string[]; warnings?: string[]; information?: string[] } {
const warnings = []
if(json.socialImage === ""){
warnings.push("Social image for theme "+json.id+" is the emtpy string")
}
return {
result :json,
warnings
};
}
}
export class PrevalidateTheme extends Fuse<LayoutConfigJson> {
constructor() {
super("Various consistency checks on the raw JSON",
new OverrideShadowingCheck()
new OverrideShadowingCheck(),
new MiscThemeChecks()
);
}