eslint: Fix @typescript-eslint/no-unnecessary-type-assertion.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-01-29 11:25:11 -08:00
committed by Tim Abbott
parent 04013cdec1
commit 2dca29ce5a
2 changed files with 3 additions and 3 deletions

View File

@@ -196,7 +196,7 @@ export async function check_form_contents(
}
export async function get_element_text(element: ElementHandle): Promise<string> {
const text = await (await element.getProperty("innerText"))!.jsonValue();
const text = await (await element.getProperty("innerText")).jsonValue();
assert.ok(typeof text === "string");
return text;
}

View File

@@ -380,7 +380,7 @@ export function emails_to_full_names_string(emails: string[]): string {
}
export function get_user_time(user_id: number): string | undefined {
const user_timezone = get_by_user_id(user_id)!.timezone;
const user_timezone = get_by_user_id(user_id).timezone;
if (user_timezone) {
try {
return new Date().toLocaleTimeString(user_settings.default_language, {
@@ -869,7 +869,7 @@ export function sender_info_for_recent_view_row(sender_ids: number[]): SenderInf
const senders_info = [];
for (const id of sender_ids) {
// TODO: Better handling for optional values w/o the assertion.
const person = get_by_user_id(id)!;
const person = get_by_user_id(id);
const sender: SenderInfo = {
...person,
avatar_url_small: small_avatar_url_for_person(person),