Add flag
This commit is contained in:
parent
6a378303e4
commit
d39d77d7ff
|
@ -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,
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue