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.

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

Anders Kaseorg2dca29ce5a83
diff --git a/web/e2e-tests/lib/common.ts b/web/e2e-tests/lib/common.ts
index 14243f265ee..d09ca5c07d4 100644
--- a/web/e2e-tests/lib/common.ts
+++ b/web/e2e-tests/lib/common.ts
@@ -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;
}
diff --git a/web/src/people.ts b/web/src/people.ts
index ae517065e5a..02a1c03850e 100644
--- a/web/src/people.ts
+++ b/web/src/people.ts
@@ -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),