Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

templates: Enable Handlebars strict mode.

Anders Kaseorgb533cd979e09
diff --git a/web/tests/lib/handlebars.js b/web/tests/lib/handlebars.js
index 6f9e7c384d9..c2eecb8a826 100644
--- a/web/tests/lib/handlebars.js
+++ b/web/tests/lib/handlebars.js
@@ -24,7 +24,7 @@ hb.JavaScriptCompiler = ZJavaScriptCompiler;
function compile_hbs(module, filename) {
const code = fs.readFileSync(filename, "utf8");
- const pc = hb.precompile(code, {preventIndent: true, srcName: filename});
+ const pc = hb.precompile(code, {preventIndent: true, srcName: filename, strict: true});
const node = new SourceNode();
node.add([
'const Handlebars = require("handlebars/runtime");\n',
diff --git a/web/webpack.config.ts b/web/webpack.config.ts
index 3569241777a..b02306bc4e2 100644
--- a/web/webpack.config.ts
+++ b/web/webpack.config.ts
@@ -146,6 +146,7 @@ export default (
"rendered_markdown",
"tooltip_hotkey_hints",
],
+ precompileOptions: {strict: true},
preventIndent: true,
// This replaces relative image resources with
// a computed require() path to them, so their