Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
eslint: Fix @typescript-eslint/consistent-type-definitions.
Anders Kaseorg084771ce7461
diff --git a/.eslintrc.json b/.eslintrc.jsonindex c3cabcdac53..59326c9abfd 100644--- a/.eslintrc.json+++ b/.eslintrc.json@@ -171,6 +171,7 @@"@typescript-eslint/array-type": "error","@typescript-eslint/consistent-type-assertions": "error",+ "@typescript-eslint/consistent-type-definitions": ["error", "type"],"@typescript-eslint/consistent-type-imports": "error","@typescript-eslint/explicit-function-return-type": ["error",diff --git a/web/src/global.d.ts b/web/src/global.d.tsindex f40ae0dc171..7e38aacdf6d 100644--- a/web/src/global.d.ts+++ b/web/src/global.d.ts@@ -5,6 +5,7 @@declare let zulip_test: any; // eslint-disable-line @typescript-eslint/no-explicit-any+// eslint-disable-next-line @typescript-eslint/consistent-type-definitionsinterface JQuery {expectOne(): JQuery;tab(action?: string): this; // From web/third/bootstrapdiff --git a/web/src/message_parser.ts b/web/src/message_parser.tsindex 85a6f3a64dc..eb5c6d708bc 100644--- a/web/src/message_parser.ts+++ b/web/src/message_parser.ts@@ -3,9 +3,9 @@ import $ from "jquery";// TODO: Move this to message_store when it is// converted to TypeScript.-interface Message {+type Message = {content: string;-}+};// We need to check if the message content contains the specified HTML// elements. We wrap the message.content in a <div>; this isdiff --git a/web/src/settings_config.ts b/web/src/settings_config.tsindex aba18e4dc71..a7aa2f134cb 100644--- a/web/src/settings_config.ts+++ b/web/src/settings_config.ts@@ -108,7 +108,7 @@ export const twenty_four_hour_time_values = {},};-export interface DisplaySettings {+export type DisplaySettings = {settings: {user_display_settings: string[];};@@ -116,7 +116,7 @@ export interface DisplaySettings {high_contrast_mode: boolean;dense_mode: boolean;};-}+};/* istanbul ignore next */export const get_all_display_settings = (): DisplaySettings => ({@@ -761,7 +761,7 @@ export function get_notifications_table_row_data(});}-export interface AllNotifications {+export type AllNotifications = {general_settings: {label: string; notification_settings: NotificationSettingCheckbox[]}[];settings: {desktop_notification_settings: string[];@@ -773,7 +773,7 @@ export interface AllNotifications {push_notifications: boolean;enable_online_push_notifications: boolean;};-}+};export const all_notifications = (settings_object: Settings): AllNotifications => ({general_settings: [diff --git a/web/src/url-template.d.ts b/web/src/url-template.d.tsindex a7d7e3180ee..dff60bf82f0 100644--- a/web/src/url-template.d.ts+++ b/web/src/url-template.d.ts@@ -6,14 +6,14 @@declare module "url-template" {export type PrimitiveValue = string | number | boolean | null;- export interface Template {+ export type Template = {expand(context: Record<string,PrimitiveValue | PrimitiveValue[] | Record<string, PrimitiveValue>>,): string;- }+ };export function parse(template: string): Template;}