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-useless-default-assignment.

Anders Kaseorgc50f555dc276
diff --git a/web/src/inbox_ui.ts b/web/src/inbox_ui.ts
index db1e19db1a6..5f7dd341222 100644
--- a/web/src/inbox_ui.ts
+++ b/web/src/inbox_ui.ts
@@ -784,7 +784,7 @@ function rerender_topic_inbox_row_if_needed(
}
}
-function get_sorted_stream_keys(channel_folder_id: number | undefined = undefined): string[] {
+function get_sorted_stream_keys(channel_folder_id?: number): string[] {
function compare_function(a: string, b: string): number {
const stream_a = streams_dict.get(a);
const stream_b = streams_dict.get(b);
diff --git a/web/src/message_edit.ts b/web/src/message_edit.ts
index 48401b59591..70af50239a8 100644
--- a/web/src/message_edit.ts
+++ b/web/src/message_edit.ts
@@ -1655,7 +1655,7 @@ export function move_topic_containing_message_to_stream(
send_notification_to_new_thread: boolean,
send_notification_to_old_thread: boolean,
propagate_mode: string,
- toast_params: ToastParams | undefined = undefined,
+ toast_params?: ToastParams,
): void {
function reset_modal_ui(): void {
currently_topic_editing_message_ids = currently_topic_editing_message_ids.filter(
diff --git a/web/src/people.ts b/web/src/people.ts
index cb643373332..9ae1ae0b95a 100644
--- a/web/src/people.ts
+++ b/web/src/people.ts
@@ -1646,10 +1646,7 @@ export function add_active_user(person: User, source = "initial_fetch"): void {
non_active_user_dict.delete(person.user_id);
}
-export const is_person_active = (
- user_id: number,
- allow_missing_user: boolean | undefined = undefined,
-): boolean => {
+export const is_person_active = (user_id: number, allow_missing_user?: boolean): boolean => {
if (!people_by_user_id_dict.has(user_id)) {
// settings_data.user_can_access_all_other_users can be
// cheap, so we avoid computing it unless it's actually
diff --git a/web/src/presence.ts b/web/src/presence.ts
index 787581a9400..1e9117fd6e3 100644
--- a/web/src/presence.ts
+++ b/web/src/presence.ts
@@ -165,7 +165,7 @@ export function status_from_raw(raw: RawPresence, user: User | undefined): Prese
export function update_info_from_event(
user_id: number,
info: z.infer<typeof presence_schema> | null,
- server_timestamp: number | undefined = undefined,
+ server_timestamp?: number,
): void {
/*
Example of `info`:
diff --git a/web/src/stream_list.ts b/web/src/stream_list.ts
index 4ff73a53182..97840c45ace 100644
--- a/web/src/stream_list.ts
+++ b/web/src/stream_list.ts
@@ -1514,7 +1514,7 @@ export function clear_search(): void {
$filter.trigger("blur");
}
-export let scroll_stream_into_view = function ($stream_li: JQuery | undefined = undefined): void {
+export let scroll_stream_into_view = function ($stream_li?: JQuery): void {
if ($stream_li === undefined) {
if (narrow_state.filter()?.terms_with_operator("topic").length === 1) {
topic_list.left_sidebar_scroll_zoomed_in_topic_into_view();
diff --git a/web/src/stream_settings_components.ts b/web/src/stream_settings_components.ts
index 5f0255ef392..826afdc9ce7 100644
--- a/web/src/stream_settings_components.ts
+++ b/web/src/stream_settings_components.ts
@@ -153,11 +153,7 @@ function hide_subscribe_toggle_spinner($stream_row: JQuery): void {
loading.destroy_indicator($spinner);
}
-export function ajaxSubscribe(
- stream: string,
- color: string | undefined = undefined,
- $stream_row: JQuery | undefined = undefined,
-): void {
+export function ajaxSubscribe(stream: string, color?: string, $stream_row?: JQuery): void {
// Subscribe yourself to a single stream.
let true_stream_name;
@@ -275,10 +271,7 @@ export function unsubscribe_from_private_stream(sub: StreamSubscription): void {
});
}
-export function sub_or_unsub(
- sub: StreamSubscription,
- $stream_row: JQuery | undefined = undefined,
-): void {
+export function sub_or_unsub(sub: StreamSubscription, $stream_row?: JQuery): void {
if (sub.subscribed) {
// TODO: This next line should allow guests to access web-public streams.
if (
diff --git a/web/src/typeahead_helper.ts b/web/src/typeahead_helper.ts
index 5fe541bf9de..e19bb3a2c85 100644
--- a/web/src/typeahead_helper.ts
+++ b/web/src/typeahead_helper.ts
@@ -1035,7 +1035,7 @@ export function rewire_sort_user_groups(value: typeof sort_user_groups): void {
export function query_matches_person_name(
query: string,
person: UserPillData,
- should_remove_diacritics: boolean | undefined = undefined,
+ should_remove_diacritics?: boolean,
match_prefix?: boolean,
): boolean {
query = query.toLowerCase();
@@ -1057,7 +1057,7 @@ export function query_matches_person_name(
export function query_matches_person(
query: string,
person: UserPillData | UserOrMentionPillData,
- should_remove_diacritics: boolean | undefined = undefined,
+ should_remove_diacritics?: boolean,
match_prefix?: boolean,
): boolean {
if (