From fb623f445049afee187ab69966b77c5ad81c4cbc Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 24 Sep 2024 19:39:23 -0700 Subject: [PATCH] eslint: Fix @typescript-eslint/no-duplicate-type-constituents. Signed-off-by: Anders Kaseorg --- web/src/blueslip.ts | 2 +- web/src/blueslip_stacktrace.ts | 2 +- web/src/email_pill.ts | 2 +- web/src/emoji_picker.ts | 2 +- web/src/input_pill.ts | 2 +- web/src/user_pill.ts | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web/src/blueslip.ts b/web/src/blueslip.ts index 66c8dbe698..387e96fb9a 100644 --- a/web/src/blueslip.ts +++ b/web/src/blueslip.ts @@ -85,7 +85,7 @@ export function warn(msg: string, more_info?: unknown): void { } } -export function error(msg: string, more_info?: object | undefined, original_error?: unknown): void { +export function error(msg: string, more_info?: object, original_error?: unknown): void { // Log the Sentry error before the console warning, so we don't // end up with a doubled message in the Sentry logs. Sentry.setContext("more_info", more_info ?? null); diff --git a/web/src/blueslip_stacktrace.ts b/web/src/blueslip_stacktrace.ts index 9907edde03..48bd726ac0 100644 --- a/web/src/blueslip_stacktrace.ts +++ b/web/src/blueslip_stacktrace.ts @@ -8,7 +8,7 @@ import render_blueslip_stacktrace from "../templates/blueslip_stacktrace.hbs"; export class BlueslipError extends Error { override name = "BlueslipError"; more_info?: object; - constructor(msg: string, more_info?: object | undefined, cause?: unknown) { + constructor(msg: string, more_info?: object, cause?: unknown) { super(msg, {cause}); if (more_info !== undefined) { this.more_info = more_info; diff --git a/web/src/email_pill.ts b/web/src/email_pill.ts index 3106851033..ba22e8c0a4 100644 --- a/web/src/email_pill.ts +++ b/web/src/email_pill.ts @@ -45,7 +45,7 @@ export function get_current_email( export function create_pills( $pill_container: JQuery, - pill_config?: InputPillConfig | undefined, + pill_config?: InputPillConfig, ): input_pill.InputPillContainer { const pill_container = input_pill.create({ $container: $pill_container, diff --git a/web/src/emoji_picker.ts b/web/src/emoji_picker.ts index 56d7ee4a41..0982250b1d 100644 --- a/web/src/emoji_picker.ts +++ b/web/src/emoji_picker.ts @@ -711,7 +711,7 @@ function get_default_emoji_popover_options(): Partial { export function toggle_emoji_popover( target: tippy.ReferenceElement, - id?: number | undefined, + id?: number, additional_popover_options?: Partial, ): void { if (id) { diff --git a/web/src/input_pill.ts b/web/src/input_pill.ts index c47c18a998..7ae041484b 100644 --- a/web/src/input_pill.ts +++ b/web/src/input_pill.ts @@ -25,7 +25,7 @@ type InputPillCreateOptions = { create_item_from_text: ( text: string, existing_items: ItemType[], - pill_config?: InputPillConfig | undefined, + pill_config?: InputPillConfig, ) => ItemType | undefined; get_text_from_item: (item: ItemType) => string; get_display_value_from_item: (item: ItemType) => string; diff --git a/web/src/user_pill.ts b/web/src/user_pill.ts index 20e26a82ab..30070f6e70 100644 --- a/web/src/user_pill.ts +++ b/web/src/user_pill.ts @@ -38,7 +38,7 @@ export type UserPillData = {type: "user"; user: User}; export function create_item_from_email( email: string, current_items: CombinedPill[], - pill_config?: InputPillConfig | undefined, + pill_config?: InputPillConfig, ): UserPill | undefined { // For normal Zulip use, we need to validate the email for our realm. const user = people.get_by_email(email); @@ -217,7 +217,7 @@ export function generate_pill_html(item: UserPill, show_user_status_emoji = fals export function create_pills( $pill_container: JQuery, - pill_config?: InputPillConfig | undefined, + pill_config?: InputPillConfig, ): input_pill.InputPillContainer { const pills = input_pill.create({ $container: $pill_container,