Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
js: Fix @typescript-eslint/restrict-plus-operands.
Anders Kaseorgf7a7cfea62a3
diff --git a/frontend_tests/puppeteer_tests/navigation.ts b/frontend_tests/puppeteer_tests/navigation.tsindex 16e0811a901..e18890a46c6 100644--- a/frontend_tests/puppeteer_tests/navigation.ts+++ b/frontend_tests/puppeteer_tests/navigation.ts@@ -62,7 +62,7 @@ async function navigate_to_subscriptions(page: Page): Promise<void> {async function test_reload_hash(page: Page): Promise<void> {const initial_page_load_time = await page.evaluate(() => zulip_test.page_params.page_load_time);- console.log("initial load time: " + initial_page_load_time);+ console.log(`initial load time: ${initial_page_load_time}`);const initial_hash = await page.evaluate(() => window.location.hash);diff --git a/frontend_tests/puppeteer_tests/realm-creation.ts b/frontend_tests/puppeteer_tests/realm-creation.tsindex cbf447a3510..ddf7b5fac2e 100644--- a/frontend_tests/puppeteer_tests/realm-creation.ts+++ b/frontend_tests/puppeteer_tests/realm-creation.ts@@ -29,7 +29,7 @@ async function realm_creation_tests(page: Page): Promise<void> {// Open the confirmation URLconst page_content = await page.evaluate(() => document.querySelector("body")!.textContent);const confirmation_key = await JSON.parse(page_content!).confirmation_key;- const confirmation_url = "http://" + host + "/accounts/do_confirm/" + confirmation_key;+ const confirmation_url = `http://${host}/accounts/do_confirm/${confirmation_key}`;await page.goto(confirmation_url);// We wait until the DOMContentLoaded event because we want the codediff --git a/static/js/blueslip.ts b/static/js/blueslip.tsindex 7659715eaf8..c371dea0e90 100644--- a/static/js/blueslip.ts+++ b/static/js/blueslip.ts@@ -167,7 +167,7 @@ export function exception_msg(if (ex.fileName !== undefined) {message += " at " + ex.fileName;if (ex.lineNumber !== undefined) {- message += ":" + ex.lineNumber;+ message += `:${ex.lineNumber}`;}}return message;diff --git a/static/js/i18n.ts b/static/js/i18n.tsindex 45e3248250b..70b57a95e8c 100644--- a/static/js/i18n.ts+++ b/static/js/i18n.ts@@ -114,7 +114,7 @@ export function get_language_list_columns(default_language: string): LanguageLisconst name = lang.name;let name_with_percent = name;if (lang.percent_translated !== undefined) {- name_with_percent = name + " (" + lang.percent_translated + "%)";+ name_with_percent = `${name} (${lang.percent_translated}%)`;}let selected = false;diff --git a/static/js/password_quality.ts b/static/js/password_quality.tsindex 96f56eb90f0..f441fef2307 100644--- a/static/js/password_quality.ts+++ b/static/js/password_quality.ts@@ -32,7 +32,7 @@ export function password_quality(// The bar bottoms out at 10% so there's always something// for the user to see.- bar.width(90 * bar_progress + 10 + "%")+ bar.width(`${90 * bar_progress + 10}%`).removeClass("bar-success bar-danger").addClass(acceptable ? "bar-success" : "bar-danger");}diff --git a/static/js/spoilers.ts b/static/js/spoilers.tsindex 890142e0299..d3b58e15650 100644--- a/static/js/spoilers.ts+++ b/static/js/spoilers.ts@@ -6,7 +6,7 @@ function collapse_spoiler(spoiler: JQuery): void {// Set height to rendered height on next frame, then to zero on following// frame to allow CSS transition animation to workrequestAnimationFrame(() => {- spoiler.height(spoiler_height + "px");+ spoiler.height(`${spoiler_height}px`);spoiler.removeClass("spoiler-content-open");requestAnimationFrame(() => {@@ -22,7 +22,7 @@ function expand_spoiler(spoiler: JQuery): void {// `auto`, so we get the actual height of the content here and temporarily// put it explicitly on the element styling to allow the transition to work.const spoiler_height = spoiler.prop("scrollHeight");- spoiler.height(spoiler_height + "px");+ spoiler.height(`${spoiler_height}px`);// The `spoiler-content-open` class has CSS animations defined on it which// will trigger on the frame after this class change.spoiler.addClass("spoiler-content-open");diff --git a/static/js/timerender.ts b/static/js/timerender.tsindex 7854c8cfb64..038cd5f2b7b 100644--- a/static/js/timerender.ts+++ b/static/js/timerender.ts@@ -203,7 +203,7 @@ function render_date_span(// of this DOM node as HTML, so effectively a copy of the node. That's// okay since to update the time later we look up the node by its id.)export function render_date(time: Date, time_above: Date | undefined, today: Date): JQuery {- const className = "timerender" + next_timerender_id;+ const className = `timerender${next_timerender_id}`;next_timerender_id += 1;const rendered_time = render_now(time, today);let node = $("<span />").attr("class", className);diff --git a/static/js/user_groups.ts b/static/js/user_groups.tsindex a4c17b127d6..0de90fcec35 100644--- a/static/js/user_groups.ts+++ b/static/js/user_groups.ts@@ -49,7 +49,7 @@ export function remove(user_group: UserGroup): void {export function get_user_group_from_id(group_id: number): UserGroup {const user_group = user_group_by_id_dict.get(group_id);if (!user_group) {- throw new Error("Unknown group_id in get_user_group_from_id: " + group_id);+ throw new Error(`Unknown group_id in get_user_group_from_id: ${group_id}`);}return user_group;}@@ -80,7 +80,7 @@ export function get_realm_user_groups(): UserGroup[] {export function is_member_of(user_group_id: number, user_id: number): boolean {const user_group = user_group_by_id_dict.get(user_group_id);if (user_group === undefined) {- blueslip.error("Could not find user group with ID " + user_group_id);+ blueslip.error(`Could not find user group with ID ${user_group_id}`);return false;}return user_group.members.has(user_id);@@ -89,7 +89,7 @@ export function is_member_of(user_group_id: number, user_id: number): boolean {export function add_members(user_group_id: number, user_ids: number[]): void {const user_group = user_group_by_id_dict.get(user_group_id);if (user_group === undefined) {- blueslip.error("Could not find user group with ID " + user_group_id);+ blueslip.error(`Could not find user group with ID ${user_group_id}`);return;}@@ -101,7 +101,7 @@ export function add_members(user_group_id: number, user_ids: number[]): void {export function remove_members(user_group_id: number, user_ids: number[]): void {const user_group = user_group_by_id_dict.get(user_group_id);if (user_group === undefined) {- blueslip.error("Could not find user group with ID " + user_group_id);+ blueslip.error(`Could not find user group with ID ${user_group_id}`);return;}