Anders Kaseorg
c09bca34b8
frontend_tests: Fix unicorn/text-encoding-identifier-case.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-01 23:09:46 -08:00
Anders Kaseorg
a9320accdc
zjsunit: Remove unnecessary Handlebars wrapper function.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-06-14 12:20:56 -07:00
Steve Howell
398cdbd922
zjsunit: Remove stub_templates helper.
...
We now use mock_template everywhere.
2021-06-14 12:05:10 -04:00
Steve Howell
ddeb15114d
zjsunit: Add mock_template helper.
...
We want to eliminate stub_templates.
2021-06-11 09:54:25 -04:00
Anders Kaseorg
83fedb4057
zjsunit: Deglobalize handlebars.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-12-01 07:14:00 -05:00
Anders Kaseorg
6ec808b8df
js: Add "use strict" directive to CommonJS files.
...
ES and TypeScript modules are strict by default and don’t need this
directive. ESLint will remind us to add it to new CommonJS files and
remove it from ES and TypeScript modules.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-31 22:09:46 -07:00
Anders Kaseorg
226598edc4
js: Use Handlebars as a module.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-29 11:17:24 -07:00
Anders Kaseorg
e3b3df328d
eslint: Replace sort-imports with import/order.
...
import/order sorts require() calls as well as import statements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-24 09:42:56 -07:00
Anders Kaseorg
883e2fd325
js: Remove inner spacing from object literals.
...
We’re configuring Prettier with bracketSpacing: false. Generated by
ESLint.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:31:25 -07:00
Anders Kaseorg
e014ea966a
eslint: Enable comma-dangle for functions.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-03 16:55:51 -07:00
Anders Kaseorg
b0253c5a2e
eslint: Enable arrow-parens.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-03 16:53:39 -07:00
Anders Kaseorg
4889a0486d
tests: Compile Handlebars templates with source maps.
...
This allows us to collect coverage for Handlebars templates, and also
improves the readability of Handlebars-related stack traces.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-02-18 07:38:46 -05:00
Anders Kaseorg
d17b577d0c
js: Purge useless IIFEs.
...
With webpack, variables declared in each file are already file-local
(Global variables need to be explicitly exported), so these IIFEs are
no longer needed.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-10-25 13:51:21 -07:00
Anders Kaseorg
b1aa304c4a
templates: Suppress Handlebars automatic partial indentation.
...
Fixes #12795 .
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-17 16:07:17 -07:00
Anders Kaseorg
0bd5c46e40
zjsunit/handlebars: Support auto-registering partials.
...
webpack with handlebars-loader already does this, so we only need to
fix up the tests.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:14 -07:00
Anders Kaseorg
db0b33842c
templates: Replace templates.render with require calls.
...
This removes an unnecessary layer of indirection and allows webpack to
catch filename mistakes.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:14 -07:00
Anders Kaseorg
706f13b671
zjsunit: Wrap Handlebars with mocking support.
...
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:14 -07:00