Add flag
This commit is contained in:
parent
6a378303e4
commit
d39d77d7ff
|
@ -2,6 +2,7 @@
|
||||||
import Handlebars from "handlebars"
|
import Handlebars from "handlebars"
|
||||||
import type { Diagnostic } from "@codemirror/lint"
|
import type { Diagnostic } from "@codemirror/lint"
|
||||||
import { CodeValidator } from "@/types"
|
import { CodeValidator } from "@/types"
|
||||||
|
import { featureFlag } from "@/helpers"
|
||||||
|
|
||||||
function isMustacheStatement(
|
function isMustacheStatement(
|
||||||
node: hbs.AST.Statement
|
node: hbs.AST.Statement
|
||||||
|
@ -94,13 +95,14 @@ export function validateHbsTemplate(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isBlockStatement(node)) {
|
if (isBlockStatement(node)) {
|
||||||
// TODO: feature flag
|
|
||||||
traverseNodes(node.program.body, { ignoreMissing: true })
|
traverseNodes(node.program.body, { ignoreMissing: true })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
traverseNodes(ast.body)
|
traverseNodes(ast.body, {
|
||||||
|
ignoreMissing: !featureFlag.isEnabled("VALIDATE_HBS_MISSING_EXPRESSIONS"),
|
||||||
|
})
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
diagnostics.push({
|
diagnostics.push({
|
||||||
from: 0,
|
from: 0,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
export enum FeatureFlag {
|
export enum FeatureFlag {
|
||||||
USE_ZOD_VALIDATOR = "USE_ZOD_VALIDATOR",
|
USE_ZOD_VALIDATOR = "USE_ZOD_VALIDATOR",
|
||||||
|
VALIDATE_HBS_MISSING_EXPRESSIONS = "VALIDATE_HBS_MISSING_EXPRESSIONS",
|
||||||
|
|
||||||
// Account-portal
|
// Account-portal
|
||||||
DIRECT_LOGIN_TO_ACCOUNT_PORTAL = "DIRECT_LOGIN_TO_ACCOUNT_PORTAL",
|
DIRECT_LOGIN_TO_ACCOUNT_PORTAL = "DIRECT_LOGIN_TO_ACCOUNT_PORTAL",
|
||||||
|
|
Loading…
Reference in New Issue