diff --git a/frontend_tests/puppeteer_tests/navigation.ts b/frontend_tests/puppeteer_tests/navigation.ts index 16e0811a90..e18890a46c 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 { async function test_reload_hash(page: Page): Promise { 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.ts index cbf447a351..ddf7b5fac2 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 { // Open the confirmation URL const 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 code diff --git a/static/js/blueslip.ts b/static/js/blueslip.ts index 7659715eaf..c371dea0e9 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.ts index 45e3248250..70b57a95e8 100644 --- a/static/js/i18n.ts +++ b/static/js/i18n.ts @@ -114,7 +114,7 @@ export function get_language_list_columns(default_language: string): LanguageLis const 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.ts index 96f56eb90f..f441fef230 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.ts index 890142e029..d3b58e1565 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 work requestAnimationFrame(() => { - 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.ts index 7854c8cfb6..038cd5f2b7 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 = $("").attr("class", className); diff --git a/static/js/user_groups.ts b/static/js/user_groups.ts index a4c17b127d..0de90fcec3 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; }