Body checks

This commit is contained in:
Adria Navarro 2025-02-27 13:22:53 +01:00
parent 6c3382f2ae
commit 56e143625d
1 changed files with 8 additions and 0 deletions

View File

@ -78,6 +78,14 @@ export function validateHbsTemplate(
message: `Helper "${helperName}" requires a body:\n{{#${helperName} ...}} [body] {{/${helperName}}}`,
})
return
} else if (!requiresBlock && isBlockStatement(node)) {
diagnostics.push({
from,
to,
severity: "error",
message: `Helper "${helperName}" should not contain a body.`,
})
return
}
let providedParamsCount = node.params.length