This commit is contained in:
Adria Navarro 2025-02-20 09:49:40 +01:00
parent 6a378303e4
commit d39d77d7ff
2 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,7 @@
import Handlebars from "handlebars"
import type { Diagnostic } from "@codemirror/lint"
import { CodeValidator } from "@/types"
import { featureFlag } from "@/helpers"
function isMustacheStatement(
node: hbs.AST.Statement
@ -94,13 +95,14 @@ export function validateHbsTemplate(
}
if (isBlockStatement(node)) {
// TODO: feature flag
traverseNodes(node.program.body, { ignoreMissing: true })
}
})
}
traverseNodes(ast.body)
traverseNodes(ast.body, {
ignoreMissing: !featureFlag.isEnabled("VALIDATE_HBS_MISSING_EXPRESSIONS"),
})
} catch (e: any) {
diagnostics.push({
from: 0,

View File

@ -1,5 +1,6 @@
export enum FeatureFlag {
USE_ZOD_VALIDATOR = "USE_ZOD_VALIDATOR",
VALIDATE_HBS_MISSING_EXPRESSIONS = "VALIDATE_HBS_MISSING_EXPRESSIONS",
// Account-portal
DIRECT_LOGIN_TO_ACCOUNT_PORTAL = "DIRECT_LOGIN_TO_ACCOUNT_PORTAL",