diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 4359767c2..29a8d474a 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -258,17 +258,7 @@ module.exports = { alphabetize: { order: 'asc' }, }, ], - '@typescript-eslint/member-delimiter-style': [ - 'error', - { - multiline: { - delimiter: 'none', - }, - singleline: { - delimiter: 'comma', - }, - }, - ], + '@typescript-eslint/member-delimiter-style': 'error', 'promise/catch-or-return': 'error', diff --git a/scripts/translationRunner.ts b/scripts/translationRunner.ts index 89c179e2e..d4557408e 100644 --- a/scripts/translationRunner.ts +++ b/scripts/translationRunner.ts @@ -8,8 +8,8 @@ import yargs from 'yargs'; type Validator = (language: string) => void; interface LanguageResult { - language: string - error: any + language: string; + error: any; } const RFC5646_REGEXP = /^[a-z]{2,3}(?:-(?:x|[A-Za-z]{2,4}))*$/; @@ -164,8 +164,8 @@ const extractedMessages = extractedMessagesFiles.reduce((acc, messageFile) => { }, [] as ExtractedDescriptor[]); interface Translation { - language: string - data: Record + language: string; + data: Record; } const translations: Translation[] = languages.map((language: string) => { @@ -188,10 +188,10 @@ function pushIfUnique(arr: T[], newItem: T): void { } interface Problem { - language: string - id: ExtractedDescriptor['id'] - severity: 'error' | 'warning' - type: string + language: string; + id: ExtractedDescriptor['id']; + severity: 'error' | 'warning'; + type: string; } const problems: Problem[] = translations.reduce((acc, translation) => { diff --git a/src/actions/admin.ts b/src/actions/admin.ts index 613615140..433cd1e00 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -201,7 +201,7 @@ const fetchReports = (params: Record = {}) => } }; -const patchMastodonReports = (reports: { id: string, state: string }[]) => +const patchMastodonReports = (reports: { id: string; state: string }[]) => (dispatch: AppDispatch, getState: () => RootState) => Promise.all(reports.map(({ id, state }) => api(getState) .post(`/api/v1/admin/reports/${id}/${state === 'resolved' ? 'reopen' : 'resolve'}`) @@ -212,7 +212,7 @@ const patchMastodonReports = (reports: { id: string, state: string }[]) => }), )); -const patchPleromaReports = (reports: { id: string, state: string }[]) => +const patchPleromaReports = (reports: { id: string; state: string }[]) => (dispatch: AppDispatch, getState: () => RootState) => api(getState) .patch('/api/v1/pleroma/admin/reports', { reports }) diff --git a/src/actions/compose.ts b/src/actions/compose.ts index fef615386..b781b99b5 100644 --- a/src/actions/compose.ts +++ b/src/actions/compose.ts @@ -101,15 +101,15 @@ const messages = defineMessages({ }); interface ComposeSetStatusAction { - type: typeof COMPOSE_SET_STATUS - id: string - status: Status - rawText: string - explicitAddressing: boolean - spoilerText?: string - contentType?: string | false - v: ReturnType - withRedraft?: boolean + type: typeof COMPOSE_SET_STATUS; + id: string; + status: Status; + rawText: string; + explicitAddressing: boolean; + spoilerText?: string; + contentType?: string | false; + v: ReturnType; + withRedraft?: boolean; } const setComposeToStatus = (status: Status, rawText: string, spoilerText?: string, contentType?: string | false, withRedraft?: boolean) => @@ -139,12 +139,12 @@ const changeCompose = (composeId: string, text: string) => ({ }); interface ComposeReplyAction { - type: typeof COMPOSE_REPLY - id: string - status: Status - account: Account - explicitAddressing: boolean - preserveSpoilers: boolean + type: typeof COMPOSE_REPLY; + id: string; + status: Status; + account: Account; + explicitAddressing: boolean; + preserveSpoilers: boolean; } const replyCompose = (status: Status) => @@ -176,11 +176,11 @@ const cancelReplyCompose = () => ({ }); interface ComposeQuoteAction { - type: typeof COMPOSE_QUOTE - id: string - status: Status - account: Account | undefined - explicitAddressing: boolean + type: typeof COMPOSE_QUOTE; + id: string; + status: Status; + account: Account | undefined; + explicitAddressing: boolean; } const quoteCompose = (status: Status) => @@ -220,9 +220,9 @@ const resetCompose = (composeId = 'compose-modal') => ({ }); interface ComposeMentionAction { - type: typeof COMPOSE_MENTION - id: string - account: Account + type: typeof COMPOSE_MENTION; + id: string; + account: Account; } const mentionCompose = (account: Account) => @@ -238,9 +238,9 @@ const mentionCompose = (account: Account) => }; interface ComposeDirectAction { - type: typeof COMPOSE_DIRECT - id: string - account: Account + type: typeof COMPOSE_DIRECT; + id: string; + account: Account; } const directCompose = (account: Account) => @@ -593,11 +593,11 @@ const fetchComposeSuggestions = (composeId: string, token: string) => }; interface ComposeSuggestionsReadyAction { - type: typeof COMPOSE_SUGGESTIONS_READY - id: string - token: string - emojis?: Emoji[] - accounts?: APIEntity[] + type: typeof COMPOSE_SUGGESTIONS_READY; + id: string; + token: string; + emojis?: Emoji[]; + accounts?: APIEntity[]; } const readyComposeSuggestionsEmojis = (composeId: string, token: string, emojis: Emoji[]) => ({ @@ -615,12 +615,12 @@ const readyComposeSuggestionsAccounts = (composeId: string, token: string, accou }); interface ComposeSuggestionSelectAction { - type: typeof COMPOSE_SUGGESTION_SELECT - id: string - position: number - token: string | null - completion: string - path: Array + type: typeof COMPOSE_SUGGESTION_SELECT; + id: string; + position: number; + token: string | null; + completion: string; + path: Array; } const selectComposeSuggestion = (composeId: string, position: number, token: string | null, suggestion: AutoSuggestion, path: Array) => @@ -774,9 +774,9 @@ const openComposeWithText = (composeId: string, text = '') => }; interface ComposeAddToMentionsAction { - type: typeof COMPOSE_ADD_TO_MENTIONS - id: string - account: string + type: typeof COMPOSE_ADD_TO_MENTIONS; + id: string; + account: string; } const addToMentions = (composeId: string, accountId: string) => @@ -795,9 +795,9 @@ const addToMentions = (composeId: string, accountId: string) => }; interface ComposeRemoveFromMentionsAction { - type: typeof COMPOSE_REMOVE_FROM_MENTIONS - id: string - account: string + type: typeof COMPOSE_REMOVE_FROM_MENTIONS; + id: string; + account: string; } const removeFromMentions = (composeId: string, accountId: string) => @@ -816,11 +816,11 @@ const removeFromMentions = (composeId: string, accountId: string) => }; interface ComposeEventReplyAction { - type: typeof COMPOSE_EVENT_REPLY - id: string - status: Status - account: Account - explicitAddressing: boolean + type: typeof COMPOSE_EVENT_REPLY; + id: string; + status: Status; + account: Account; + explicitAddressing: boolean; } const eventDiscussionCompose = (composeId: string, status: Status) => diff --git a/src/actions/events.ts b/src/actions/events.ts index 6d62d4585..ae291a185 100644 --- a/src/actions/events.ts +++ b/src/actions/events.ts @@ -545,10 +545,10 @@ const cancelEventCompose = () => ({ }); interface EventFormSetAction { - type: typeof EVENT_FORM_SET - status: ReducerStatus - text: string - location: Record + type: typeof EVENT_FORM_SET; + status: ReducerStatus; + text: string; + location: Record; } const editEvent = (id: string) => (dispatch: AppDispatch, getState: () => RootState) => { diff --git a/src/actions/export-data.ts b/src/actions/export-data.ts index 519725ea2..b5bf805de 100644 --- a/src/actions/export-data.ts +++ b/src/actions/export-data.ts @@ -34,8 +34,8 @@ type ExportDataActions = { | typeof EXPORT_BLOCKS_FAIL | typeof EXPORT_MUTES_REQUEST | typeof EXPORT_MUTES_SUCCESS - | typeof EXPORT_MUTES_FAIL - error?: any + | typeof EXPORT_MUTES_FAIL; + error?: any; } function fileExport(content: string, fileName: string) { diff --git a/src/actions/filters.ts b/src/actions/filters.ts index ee3508682..fe7026876 100644 --- a/src/actions/filters.ts +++ b/src/actions/filters.ts @@ -33,7 +33,7 @@ const messages = defineMessages({ removed: { id: 'filters.removed', defaultMessage: 'Filter deleted.' }, }); -type FilterKeywords = { keyword: string, whole_word: boolean }[]; +type FilterKeywords = { keyword: string; whole_word: boolean }[]; const fetchFiltersV1 = () => (dispatch: AppDispatch, getState: () => RootState) => { diff --git a/src/actions/import-data.ts b/src/actions/import-data.ts index 023529453..c518d1a16 100644 --- a/src/actions/import-data.ts +++ b/src/actions/import-data.ts @@ -27,9 +27,9 @@ type ImportDataActions = { | typeof IMPORT_BLOCKS_FAIL | typeof IMPORT_MUTES_REQUEST | typeof IMPORT_MUTES_SUCCESS - | typeof IMPORT_MUTES_FAIL - error?: any - config?: string + | typeof IMPORT_MUTES_FAIL; + error?: any; + config?: string; } const messages = defineMessages({ diff --git a/src/actions/me.ts b/src/actions/me.ts index bc4073b70..4e02a6e62 100644 --- a/src/actions/me.ts +++ b/src/actions/me.ts @@ -104,8 +104,8 @@ const patchMeRequest = () => ({ }); interface MePatchSuccessAction { - type: typeof ME_PATCH_SUCCESS - me: APIEntity + type: typeof ME_PATCH_SUCCESS; + me: APIEntity; } const patchMeSuccess = (me: APIEntity) => diff --git a/src/actions/onboarding.ts b/src/actions/onboarding.ts index ff12bd074..f75a89c4b 100644 --- a/src/actions/onboarding.ts +++ b/src/actions/onboarding.ts @@ -4,11 +4,11 @@ const ONBOARDING_END = 'ONBOARDING_END'; const ONBOARDING_LOCAL_STORAGE_KEY = 'soapbox:onboarding'; type OnboardingStartAction = { - type: typeof ONBOARDING_START + type: typeof ONBOARDING_START; } type OnboardingEndAction = { - type: typeof ONBOARDING_END + type: typeof ONBOARDING_END; } export type OnboardingActions = OnboardingStartAction | OnboardingEndAction diff --git a/src/actions/push-notifications/registerer.ts b/src/actions/push-notifications/registerer.ts index 2ea7fbab8..48a0bc8fd 100644 --- a/src/actions/push-notifications/registerer.ts +++ b/src/actions/push-notifications/registerer.ts @@ -37,8 +37,8 @@ const subscribe = (registration: ServiceWorkerRegistration, getState: () => Root }); const unsubscribe = ({ registration, subscription }: { - registration: ServiceWorkerRegistration - subscription: PushSubscription | null + registration: ServiceWorkerRegistration; + subscription: PushSubscription | null; }) => subscription ? subscription.unsubscribe().then(() => registration) : new Promise(r => r(registration)); @@ -82,8 +82,8 @@ const register = () => .then(getPushSubscription) // @ts-ignore .then(({ registration, subscription }: { - registration: ServiceWorkerRegistration - subscription: PushSubscription | null + registration: ServiceWorkerRegistration; + subscription: PushSubscription | null; }) => { if (subscription !== null) { // We have a subscription, check if it is still valid diff --git a/src/actions/reports.ts b/src/actions/reports.ts index be6a60ed8..4ad65a21e 100644 --- a/src/actions/reports.ts +++ b/src/actions/reports.ts @@ -29,9 +29,9 @@ enum ReportableEntities { } type ReportedEntity = { - status?: Status - chatMessage?: ChatMessage - group?: Group + status?: Status; + chatMessage?: ChatMessage; + group?: Group; } const initReport = (entityType: ReportableEntities, account: Account, entities?: ReportedEntity) => (dispatch: AppDispatch) => { diff --git a/src/actions/rules.ts b/src/actions/rules.ts index b5b3b90a4..242d0bbda 100644 --- a/src/actions/rules.ts +++ b/src/actions/rules.ts @@ -7,12 +7,12 @@ const RULES_FETCH_REQUEST = 'RULES_FETCH_REQUEST'; const RULES_FETCH_SUCCESS = 'RULES_FETCH_SUCCESS'; type RulesFetchRequestAction = { - type: typeof RULES_FETCH_REQUEST + type: typeof RULES_FETCH_REQUEST; } type RulesFetchRequestSuccessAction = { - type: typeof RULES_FETCH_SUCCESS - payload: Rule[] + type: typeof RULES_FETCH_SUCCESS; + payload: Rule[]; } export type RulesActions = RulesFetchRequestAction | RulesFetchRequestSuccessAction diff --git a/src/actions/settings.ts b/src/actions/settings.ts index 57db0e438..ae6a3ec35 100644 --- a/src/actions/settings.ts +++ b/src/actions/settings.ts @@ -19,7 +19,7 @@ const FE_NAME = 'soapbox_fe'; /** Options when changing/saving settings. */ type SettingOpts = { /** Whether to display an alert when settings are saved. */ - showAlert?: boolean + showAlert?: boolean; } const saveSuccessMessage = defineMessage({ id: 'settings.save.success', defaultMessage: 'Your preferences have been saved!' }); @@ -183,9 +183,9 @@ const getSettings = createSelector([ }); interface SettingChangeAction { - type: typeof SETTING_CHANGE - path: string[] - value: any + type: typeof SETTING_CHANGE; + path: string[]; + value: any; } const changeSettingImmediate = (path: string[], value: any, opts?: SettingOpts) => diff --git a/src/actions/streaming.ts b/src/actions/streaming.ts index e72b20239..9557757ae 100644 --- a/src/actions/streaming.ts +++ b/src/actions/streaming.ts @@ -65,8 +65,8 @@ const updateChatQuery = (chat: IChat) => { }; interface TimelineStreamOpts { - statContext?: IStatContext - enabled?: boolean + statContext?: IStatContext; + enabled?: boolean; } const connectTimelineStream = ( @@ -192,17 +192,17 @@ function followStateToRelationship(followState: string) { } interface FollowUpdate { - state: 'follow_pending' | 'follow_accept' | 'follow_reject' + state: 'follow_pending' | 'follow_accept' | 'follow_reject'; follower: { - id: string - follower_count: number - following_count: number - } + id: string; + follower_count: number; + following_count: number; + }; following: { - id: string - follower_count: number - following_count: number - } + id: string; + follower_count: number; + following_count: number; + }; } function updateFollowRelationships(update: FollowUpdate) { diff --git a/src/actions/timelines.ts b/src/actions/timelines.ts index 1de17863e..03198652f 100644 --- a/src/actions/timelines.ts +++ b/src/actions/timelines.ts @@ -110,11 +110,11 @@ const dequeueTimeline = (timelineId: string, expandFunc?: (lastStatusId: string) }; interface TimelineDeleteAction { - type: typeof TIMELINE_DELETE - id: string - accountId: string - references: ImmutableMap - reblogOf: unknown + type: typeof TIMELINE_DELETE; + id: string; + accountId: string; + references: ImmutableMap; + reblogOf: unknown; } const deleteFromTimelines = (id: string) => @@ -193,14 +193,14 @@ const expandTimeline = (timelineId: string, path: string, params: Record { diff --git a/src/api/hooks/accounts/useAccount.ts b/src/api/hooks/accounts/useAccount.ts index e7f8b8fea..865b149ad 100644 --- a/src/api/hooks/accounts/useAccount.ts +++ b/src/api/hooks/accounts/useAccount.ts @@ -10,7 +10,7 @@ import { type Account, accountSchema } from 'soapbox/schemas'; import { useRelationship } from './useRelationship'; interface UseAccountOpts { - withRelationship?: boolean + withRelationship?: boolean; } function useAccount(accountId?: string, opts: UseAccountOpts = {}) { diff --git a/src/api/hooks/accounts/useAccountList.ts b/src/api/hooks/accounts/useAccountList.ts index cb82153e0..ec769224b 100644 --- a/src/api/hooks/accounts/useAccountList.ts +++ b/src/api/hooks/accounts/useAccountList.ts @@ -8,7 +8,7 @@ import { useRelationships } from './useRelationships'; import type { EntityFn } from 'soapbox/entity-store/hooks/types'; interface useAccountListOpts { - enabled?: boolean + enabled?: boolean; } function useAccountList(listKey: string[], entityFn: EntityFn, opts: useAccountListOpts = {}) { diff --git a/src/api/hooks/accounts/useAccountLookup.ts b/src/api/hooks/accounts/useAccountLookup.ts index ed73617aa..7aed05f98 100644 --- a/src/api/hooks/accounts/useAccountLookup.ts +++ b/src/api/hooks/accounts/useAccountLookup.ts @@ -10,7 +10,7 @@ import { type Account, accountSchema } from 'soapbox/schemas'; import { useRelationship } from './useRelationship'; interface UseAccountLookupOpts { - withRelationship?: boolean + withRelationship?: boolean; } function useAccountLookup(acct: string | undefined, opts: UseAccountLookupOpts = {}) { diff --git a/src/api/hooks/accounts/useFollow.ts b/src/api/hooks/accounts/useFollow.ts index 3d81182be..60282c4ac 100644 --- a/src/api/hooks/accounts/useFollow.ts +++ b/src/api/hooks/accounts/useFollow.ts @@ -6,9 +6,9 @@ import { useApi } from 'soapbox/hooks/useApi'; import { relationshipSchema } from 'soapbox/schemas'; interface FollowOpts { - reblogs?: boolean - notify?: boolean - languages?: string[] + reblogs?: boolean; + notify?: boolean; + languages?: string[]; } function useFollow() { diff --git a/src/api/hooks/accounts/useRelationship.ts b/src/api/hooks/accounts/useRelationship.ts index e0793108b..6424a2876 100644 --- a/src/api/hooks/accounts/useRelationship.ts +++ b/src/api/hooks/accounts/useRelationship.ts @@ -6,7 +6,7 @@ import { useApi } from 'soapbox/hooks'; import { type Relationship, relationshipSchema } from 'soapbox/schemas'; interface UseRelationshipOpts { - enabled?: boolean + enabled?: boolean; } function useRelationship(accountId: string | undefined, opts: UseRelationshipOpts = {}) { diff --git a/src/api/hooks/groups/useCreateGroup.ts b/src/api/hooks/groups/useCreateGroup.ts index 302374946..e80417856 100644 --- a/src/api/hooks/groups/useCreateGroup.ts +++ b/src/api/hooks/groups/useCreateGroup.ts @@ -4,13 +4,13 @@ import { useApi } from 'soapbox/hooks/useApi'; import { groupSchema } from 'soapbox/schemas'; interface CreateGroupParams { - display_name?: string - note?: string - avatar?: File - header?: File - group_visibility?: 'members_only' | 'everyone' - discoverable?: boolean - tags?: string[] + display_name?: string; + note?: string; + avatar?: File; + header?: File; + group_visibility?: 'members_only' | 'everyone'; + discoverable?: boolean; + tags?: string[]; } function useCreateGroup() { diff --git a/src/api/hooks/groups/useGroupValidation.ts b/src/api/hooks/groups/useGroupValidation.ts index bfcd3bbb0..ffa35eb6f 100644 --- a/src/api/hooks/groups/useGroupValidation.ts +++ b/src/api/hooks/groups/useGroupValidation.ts @@ -4,8 +4,8 @@ import { useApi } from 'soapbox/hooks/useApi'; import { useFeatures } from 'soapbox/hooks/useFeatures'; type Validation = { - error: string - message: string + error: string; + message: string; } const ValidationKeys = { diff --git a/src/api/hooks/groups/useUpdateGroup.ts b/src/api/hooks/groups/useUpdateGroup.ts index b4ec0aa54..129849514 100644 --- a/src/api/hooks/groups/useUpdateGroup.ts +++ b/src/api/hooks/groups/useUpdateGroup.ts @@ -4,13 +4,13 @@ import { useApi } from 'soapbox/hooks/useApi'; import { groupSchema } from 'soapbox/schemas'; interface UpdateGroupParams { - display_name?: string - note?: string - avatar?: File | '' - header?: File | '' - group_visibility?: string - discoverable?: boolean - tags?: string[] + display_name?: string; + note?: string; + avatar?: File | ''; + header?: File | ''; + group_visibility?: string; + discoverable?: boolean; + tags?: string[]; } function useUpdateGroup(groupId: string) { diff --git a/src/api/hooks/streaming/useCommunityStream.ts b/src/api/hooks/streaming/useCommunityStream.ts index 5db097ae5..ce00d4674 100644 --- a/src/api/hooks/streaming/useCommunityStream.ts +++ b/src/api/hooks/streaming/useCommunityStream.ts @@ -1,8 +1,8 @@ import { useTimelineStream } from './useTimelineStream'; interface UseCommunityStreamOpts { - onlyMedia?: boolean - enabled?: boolean + onlyMedia?: boolean; + enabled?: boolean; } function useCommunityStream({ onlyMedia, enabled }: UseCommunityStreamOpts = {}) { diff --git a/src/api/hooks/streaming/usePublicStream.ts b/src/api/hooks/streaming/usePublicStream.ts index eb189c996..7a6f7f61d 100644 --- a/src/api/hooks/streaming/usePublicStream.ts +++ b/src/api/hooks/streaming/usePublicStream.ts @@ -1,7 +1,7 @@ import { useTimelineStream } from './useTimelineStream'; interface UsePublicStreamOpts { - onlyMedia?: boolean + onlyMedia?: boolean; } function usePublicStream({ onlyMedia }: UsePublicStreamOpts = {}) { diff --git a/src/api/hooks/streaming/useRemoteStream.ts b/src/api/hooks/streaming/useRemoteStream.ts index f67f99083..6de560163 100644 --- a/src/api/hooks/streaming/useRemoteStream.ts +++ b/src/api/hooks/streaming/useRemoteStream.ts @@ -1,8 +1,8 @@ import { useTimelineStream } from './useTimelineStream'; interface UseRemoteStreamOpts { - instance: string - onlyMedia?: boolean + instance: string; + onlyMedia?: boolean; } function useRemoteStream({ instance, onlyMedia }: UseRemoteStreamOpts) { diff --git a/src/components/__mocks__/react-inlinesvg.tsx b/src/components/__mocks__/react-inlinesvg.tsx index 1317dcbcb..f9a7cd892 100644 --- a/src/components/__mocks__/react-inlinesvg.tsx +++ b/src/components/__mocks__/react-inlinesvg.tsx @@ -1,7 +1,7 @@ import React from 'react'; interface IInlineSVG { - loader?: JSX.Element + loader?: JSX.Element; } const InlineSVG: React.FC = ({ loader }): JSX.Element => { diff --git a/src/components/account-search.tsx b/src/components/account-search.tsx index cbaab0f18..4daffd70b 100644 --- a/src/components/account-search.tsx +++ b/src/components/account-search.tsx @@ -12,9 +12,9 @@ const messages = defineMessages({ interface IAccountSearch { /** Callback when a searched account is chosen. */ - onSelected: (accountId: string) => void + onSelected: (accountId: string) => void; /** Override the default placeholder of the input. */ - placeholder?: string + placeholder?: string; } /** Input to search for accounts. */ diff --git a/src/components/account.tsx b/src/components/account.tsx index 652a35dc0..ad4766ecd 100644 --- a/src/components/account.tsx +++ b/src/components/account.tsx @@ -17,8 +17,8 @@ import type { StatusApprovalStatus } from 'soapbox/normalizers/status'; import type { Account as AccountSchema } from 'soapbox/schemas'; interface IInstanceFavicon { - account: AccountSchema - disabled?: boolean + account: AccountSchema; + disabled?: boolean; } const messages = defineMessages({ @@ -57,9 +57,9 @@ const InstanceFavicon: React.FC = ({ account, disabled }) => { }; interface IProfilePopper { - condition: boolean - wrapper: (children: React.ReactNode) => React.ReactNode - children: React.ReactNode + condition: boolean; + wrapper: (children: React.ReactNode) => React.ReactNode; + children: React.ReactNode; } const ProfilePopper: React.FC = ({ condition, wrapper, children }) => { @@ -71,31 +71,31 @@ const ProfilePopper: React.FC = ({ condition, wrapper, children }; export interface IAccount { - account: AccountSchema - action?: React.ReactElement - actionAlignment?: 'center' | 'top' - actionIcon?: string - actionTitle?: string + account: AccountSchema; + action?: React.ReactElement; + actionAlignment?: 'center' | 'top'; + actionIcon?: string; + actionTitle?: string; /** Override other actions for specificity like mute/unmute. */ - actionType?: 'muting' | 'blocking' | 'follow_request' - avatarSize?: number - hidden?: boolean - hideActions?: boolean - id?: string - onActionClick?: (account: any) => void - showProfileHoverCard?: boolean - timestamp?: string - timestampUrl?: string - futureTimestamp?: boolean - withAccountNote?: boolean - withDate?: boolean - withLinkToProfile?: boolean - withRelationship?: boolean - showEdit?: boolean - approvalStatus?: StatusApprovalStatus - emoji?: string - emojiUrl?: string - note?: string + actionType?: 'muting' | 'blocking' | 'follow_request'; + avatarSize?: number; + hidden?: boolean; + hideActions?: boolean; + id?: string; + onActionClick?: (account: any) => void; + showProfileHoverCard?: boolean; + timestamp?: string; + timestampUrl?: string; + futureTimestamp?: boolean; + withAccountNote?: boolean; + withDate?: boolean; + withLinkToProfile?: boolean; + withRelationship?: boolean; + showEdit?: boolean; + approvalStatus?: StatusApprovalStatus; + emoji?: string; + emojiUrl?: string; + note?: string; } const Account = ({ diff --git a/src/components/animated-number.tsx b/src/components/animated-number.tsx index 199a8b4db..e7dd82462 100644 --- a/src/components/animated-number.tsx +++ b/src/components/animated-number.tsx @@ -15,8 +15,8 @@ const obfuscatedCount = (count: number) => { }; interface IAnimatedNumber { - value: number - obfuscate?: boolean + value: number; + obfuscate?: boolean; } const AnimatedNumber: React.FC = ({ value, obfuscate }) => { diff --git a/src/components/announcements/announcement-content.tsx b/src/components/announcements/announcement-content.tsx index 459f88e64..f4265d1fd 100644 --- a/src/components/announcements/announcement-content.tsx +++ b/src/components/announcements/announcement-content.tsx @@ -4,7 +4,7 @@ import { useHistory } from 'react-router-dom'; import type { Announcement as AnnouncementEntity, Mention as MentionEntity } from 'soapbox/types/entities'; interface IAnnouncementContent { - announcement: AnnouncementEntity + announcement: AnnouncementEntity; } const AnnouncementContent: React.FC = ({ announcement }) => { diff --git a/src/components/announcements/announcement.tsx b/src/components/announcements/announcement.tsx index 62d5a1170..ea96b37fd 100644 --- a/src/components/announcements/announcement.tsx +++ b/src/components/announcements/announcement.tsx @@ -11,10 +11,10 @@ import type { Map as ImmutableMap } from 'immutable'; import type { Announcement as AnnouncementEntity } from 'soapbox/types/entities'; interface IAnnouncement { - announcement: AnnouncementEntity - addReaction: (id: string, name: string) => void - removeReaction: (id: string, name: string) => void - emojiMap: ImmutableMap> + announcement: AnnouncementEntity; + addReaction: (id: string, name: string) => void; + removeReaction: (id: string, name: string) => void; + emojiMap: ImmutableMap>; } const Announcement: React.FC = ({ announcement, addReaction, removeReaction, emojiMap }) => { diff --git a/src/components/announcements/emoji.tsx b/src/components/announcements/emoji.tsx index 0059e02b7..b3dd0fcc5 100644 --- a/src/components/announcements/emoji.tsx +++ b/src/components/announcements/emoji.tsx @@ -7,9 +7,9 @@ import { joinPublicPath } from 'soapbox/utils/static'; import type { Map as ImmutableMap } from 'immutable'; interface IEmoji { - emoji: string - emojiMap: ImmutableMap> - hovered: boolean + emoji: string; + emojiMap: ImmutableMap>; + hovered: boolean; } const Emoji: React.FC = ({ emoji, emojiMap, hovered }) => { diff --git a/src/components/announcements/reaction.tsx b/src/components/announcements/reaction.tsx index 0d7bd973f..2985514a5 100644 --- a/src/components/announcements/reaction.tsx +++ b/src/components/announcements/reaction.tsx @@ -10,12 +10,12 @@ import type { Map as ImmutableMap } from 'immutable'; import type { AnnouncementReaction } from 'soapbox/types/entities'; interface IReaction { - announcementId: string - reaction: AnnouncementReaction - emojiMap: ImmutableMap> - addReaction: (id: string, name: string) => void - removeReaction: (id: string, name: string) => void - style: React.CSSProperties + announcementId: string; + reaction: AnnouncementReaction; + emojiMap: ImmutableMap>; + addReaction: (id: string, name: string) => void; + removeReaction: (id: string, name: string) => void; + style: React.CSSProperties; } const Reaction: React.FC = ({ announcementId, reaction, addReaction, removeReaction, emojiMap, style }) => { diff --git a/src/components/announcements/reactions-bar.tsx b/src/components/announcements/reactions-bar.tsx index 55b72c59a..97324b89e 100644 --- a/src/components/announcements/reactions-bar.tsx +++ b/src/components/announcements/reactions-bar.tsx @@ -12,11 +12,11 @@ import type { Emoji, NativeEmoji } from 'soapbox/features/emoji'; import type { AnnouncementReaction } from 'soapbox/types/entities'; interface IReactionsBar { - announcementId: string - reactions: ImmutableList - emojiMap: ImmutableMap> - addReaction: (id: string, name: string) => void - removeReaction: (id: string, name: string) => void + announcementId: string; + reactions: ImmutableList; + emojiMap: ImmutableMap>; + addReaction: (id: string, name: string) => void; + removeReaction: (id: string, name: string) => void; } const ReactionsBar: React.FC = ({ announcementId, reactions, addReaction, removeReaction, emojiMap }) => { diff --git a/src/components/attachment-thumbs.tsx b/src/components/attachment-thumbs.tsx index 25b4bec00..1ec694667 100644 --- a/src/components/attachment-thumbs.tsx +++ b/src/components/attachment-thumbs.tsx @@ -9,9 +9,9 @@ import type { List as ImmutableList } from 'immutable'; import type { Attachment } from 'soapbox/types/entities'; interface IAttachmentThumbs { - media: ImmutableList - onClick?(): void - sensitive?: boolean + media: ImmutableList; + onClick?(): void; + sensitive?: boolean; } const AttachmentThumbs = (props: IAttachmentThumbs) => { diff --git a/src/components/authorize-reject-buttons.tsx b/src/components/authorize-reject-buttons.tsx index 5dfb37a31..aa6a39ab7 100644 --- a/src/components/authorize-reject-buttons.tsx +++ b/src/components/authorize-reject-buttons.tsx @@ -5,9 +5,9 @@ import { FormattedMessage } from 'react-intl'; import { HStack, IconButton, Text } from 'soapbox/components/ui'; interface IAuthorizeRejectButtons { - onAuthorize(): Promise | unknown - onReject(): Promise | unknown - countdown?: number + onAuthorize(): Promise | unknown; + onReject(): Promise | unknown; + countdown?: number; } /** Buttons to approve or reject a pending item, usually an account. */ @@ -126,7 +126,7 @@ const AuthorizeRejectButtons: React.FC = ({ onAuthorize }; interface IActionEmblem { - text: React.ReactNode + text: React.ReactNode; } const ActionEmblem: React.FC = ({ text }) => { @@ -140,12 +140,12 @@ const ActionEmblem: React.FC = ({ text }) => { }; interface IAuthorizeRejectButton { - theme: 'primary' | 'danger' - icon: string - action(): void - isLoading?: boolean - disabled?: boolean - style: React.CSSProperties + theme: 'primary' | 'danger'; + icon: string; + action(): void; + isLoading?: boolean; + disabled?: boolean; + style: React.CSSProperties; } const AuthorizeRejectButton: React.FC = ({ theme, icon, action, isLoading, style, disabled }) => { diff --git a/src/components/autosuggest-account-input.tsx b/src/components/autosuggest-account-input.tsx index d191aec15..1b7c05499 100644 --- a/src/components/autosuggest-account-input.tsx +++ b/src/components/autosuggest-account-input.tsx @@ -12,16 +12,16 @@ import type { InputThemes } from 'soapbox/components/ui/input/input'; const noOp = () => { }; interface IAutosuggestAccountInput { - onChange: React.ChangeEventHandler - onSelected: (accountId: string) => void - autoFocus?: boolean - value: string - limit?: number - className?: string - autoSelect?: boolean - menu?: Menu - onKeyDown?: React.KeyboardEventHandler - theme?: InputThemes + onChange: React.ChangeEventHandler; + onSelected: (accountId: string) => void; + autoFocus?: boolean; + value: string; + limit?: number; + className?: string; + autoSelect?: boolean; + menu?: Menu; + onKeyDown?: React.KeyboardEventHandler; + theme?: InputThemes; } const AutosuggestAccountInput: React.FC = ({ diff --git a/src/components/autosuggest-emoji.tsx b/src/components/autosuggest-emoji.tsx index 4f4471ecf..26f507b72 100644 --- a/src/components/autosuggest-emoji.tsx +++ b/src/components/autosuggest-emoji.tsx @@ -7,7 +7,7 @@ import { joinPublicPath } from 'soapbox/utils/static'; import type { Emoji } from 'soapbox/features/emoji'; interface IAutosuggestEmoji { - emoji: Emoji + emoji: Emoji; } const AutosuggestEmoji: React.FC = ({ emoji }) => { diff --git a/src/components/autosuggest-input.tsx b/src/components/autosuggest-input.tsx index 074acfef4..1846b02d0 100644 --- a/src/components/autosuggest-input.tsx +++ b/src/components/autosuggest-input.tsx @@ -17,23 +17,23 @@ import type { Emoji } from 'soapbox/features/emoji'; export type AutoSuggestion = string | Emoji; export interface IAutosuggestInput extends Pick, 'onChange' | 'onKeyUp' | 'onKeyDown'> { - value: string - suggestions: ImmutableList - disabled?: boolean - placeholder?: string - onSuggestionSelected: (tokenStart: number, lastToken: string | null, suggestion: AutoSuggestion) => void - onSuggestionsClearRequested: () => void - onSuggestionsFetchRequested: (token: string) => void - autoFocus: boolean - autoSelect: boolean - className?: string - id?: string - searchTokens: string[] - maxLength?: number - menu?: Menu - renderSuggestion?: React.FC<{ id: string }> - hidePortal?: boolean - theme?: InputThemes + value: string; + suggestions: ImmutableList; + disabled?: boolean; + placeholder?: string; + onSuggestionSelected: (tokenStart: number, lastToken: string | null, suggestion: AutoSuggestion) => void; + onSuggestionsClearRequested: () => void; + onSuggestionsFetchRequested: (token: string) => void; + autoFocus: boolean; + autoSelect: boolean; + className?: string; + id?: string; + searchTokens: string[]; + maxLength?: number; + menu?: Menu; + renderSuggestion?: React.FC<{ id: string }>; + hidePortal?: boolean; + theme?: InputThemes; } export default class AutosuggestInput extends ImmutablePureComponent { diff --git a/src/components/autosuggest-location.tsx b/src/components/autosuggest-location.tsx index 23ea09807..e94158bb0 100644 --- a/src/components/autosuggest-location.tsx +++ b/src/components/autosuggest-location.tsx @@ -19,7 +19,7 @@ export const ADDRESS_ICONS: Record = { }; interface IAutosuggestLocation { - id: string + id: string; } const AutosuggestLocation: React.FC = ({ id }) => { diff --git a/src/components/autosuggest-textarea.tsx b/src/components/autosuggest-textarea.tsx index e0be3c958..bc19c15e5 100644 --- a/src/components/autosuggest-textarea.tsx +++ b/src/components/autosuggest-textarea.tsx @@ -14,23 +14,23 @@ import type { List as ImmutableList } from 'immutable'; import type { Emoji } from 'soapbox/features/emoji'; interface IAutosuggesteTextarea { - id?: string - value: string - suggestions: ImmutableList - disabled: boolean - placeholder: string - onSuggestionSelected: (tokenStart: number, token: string | null, value: string | undefined) => void - onSuggestionsClearRequested: () => void - onSuggestionsFetchRequested: (token: string | number) => void - onChange: React.ChangeEventHandler - onKeyUp?: React.KeyboardEventHandler - onKeyDown?: React.KeyboardEventHandler - onPaste: (files: FileList) => void - autoFocus: boolean - onFocus: () => void - onBlur?: () => void - condensed?: boolean - children: React.ReactNode + id?: string; + value: string; + suggestions: ImmutableList; + disabled: boolean; + placeholder: string; + onSuggestionSelected: (tokenStart: number, token: string | null, value: string | undefined) => void; + onSuggestionsClearRequested: () => void; + onSuggestionsFetchRequested: (token: string | number) => void; + onChange: React.ChangeEventHandler; + onKeyUp?: React.KeyboardEventHandler; + onKeyDown?: React.KeyboardEventHandler; + onPaste: (files: FileList) => void; + autoFocus: boolean; + onFocus: () => void; + onBlur?: () => void; + condensed?: boolean; + children: React.ReactNode; } class AutosuggestTextarea extends ImmutablePureComponent { diff --git a/src/components/avatar-stack.tsx b/src/components/avatar-stack.tsx index b7dbb050d..e9193d344 100644 --- a/src/components/avatar-stack.tsx +++ b/src/components/avatar-stack.tsx @@ -11,8 +11,8 @@ import type { Account } from 'soapbox/types/entities'; const getAccount = makeGetAccount(); interface IAvatarStack { - accountIds: ImmutableOrderedSet - limit?: number + accountIds: ImmutableOrderedSet; + limit?: number; } const AvatarStack: React.FC = ({ accountIds, limit = 3 }) => { diff --git a/src/components/badge.tsx b/src/components/badge.tsx index fac7487e0..eeb03e38b 100644 --- a/src/components/badge.tsx +++ b/src/components/badge.tsx @@ -2,8 +2,8 @@ import clsx from 'clsx'; import React from 'react'; interface IBadge { - title: React.ReactNode - slug: string + title: React.ReactNode; + slug: string; } /** Badge to display on a user's profile. */ const Badge: React.FC = ({ title, slug }) => { diff --git a/src/components/big-card.tsx b/src/components/big-card.tsx index 2fcb7078a..895ac1298 100644 --- a/src/components/big-card.tsx +++ b/src/components/big-card.tsx @@ -3,9 +3,9 @@ import React from 'react'; import { Card, CardBody, Stack, Text } from 'soapbox/components/ui'; interface IBigCard { - title: React.ReactNode - subtitle?: React.ReactNode - children: React.ReactNode + title: React.ReactNode; + subtitle?: React.ReactNode; + children: React.ReactNode; } const BigCard: React.FC = ({ title, subtitle, children }) => { diff --git a/src/components/birthday-input.tsx b/src/components/birthday-input.tsx index 410f3d202..a35e85055 100644 --- a/src/components/birthday-input.tsx +++ b/src/components/birthday-input.tsx @@ -15,9 +15,9 @@ const messages = defineMessages({ }); interface IBirthdayInput { - value?: string - onChange: (value: string) => void - required?: boolean + value?: string; + onChange: (value: string) => void; + required?: boolean; } const BirthdayInput: React.FC = ({ value, onChange, required }) => { @@ -56,15 +56,15 @@ const BirthdayInput: React.FC = ({ value, onChange, required }) nextYearButtonDisabled, date, }: { - decreaseMonth(): void - increaseMonth(): void - prevMonthButtonDisabled: boolean - nextMonthButtonDisabled: boolean - decreaseYear(): void - increaseYear(): void - prevYearButtonDisabled: boolean - nextYearButtonDisabled: boolean - date: Date + decreaseMonth(): void; + increaseMonth(): void; + prevMonthButtonDisabled: boolean; + nextMonthButtonDisabled: boolean; + decreaseYear(): void; + increaseYear(): void; + prevYearButtonDisabled: boolean; + nextYearButtonDisabled: boolean; + date: Date; }) => { return (
diff --git a/src/components/birthday-panel.tsx b/src/components/birthday-panel.tsx index bcfe5d073..f1f31d94e 100644 --- a/src/components/birthday-panel.tsx +++ b/src/components/birthday-panel.tsx @@ -15,7 +15,7 @@ const timeToMidnight = () => { }; interface IBirthdayPanel { - limit: number + limit: number; } const BirthdayPanel = ({ limit }: IBirthdayPanel) => { diff --git a/src/components/blurhash.tsx b/src/components/blurhash.tsx index d0e0f43b9..c492b0e05 100644 --- a/src/components/blurhash.tsx +++ b/src/components/blurhash.tsx @@ -3,18 +3,18 @@ import React, { useRef, useEffect } from 'react'; interface IBlurhash { /** Hash to render */ - hash: string | null | undefined + hash: string | null | undefined; /** Width of the blurred region in pixels. Defaults to 32. */ - width?: number + width?: number; /** Height of the blurred region in pixels. Defaults to width. */ - height?: number + height?: number; /** * Whether dummy mode is enabled. If enabled, nothing is rendered * and canvas left untouched. */ - dummy?: boolean + dummy?: boolean; /** className of the canvas element. */ - className?: string + className?: string; } /** diff --git a/src/components/copyable-input.tsx b/src/components/copyable-input.tsx index 57f4db55d..2422c8276 100644 --- a/src/components/copyable-input.tsx +++ b/src/components/copyable-input.tsx @@ -5,7 +5,7 @@ import { Button, HStack, Input } from './ui'; interface ICopyableInput { /** Text to be copied. */ - value: string + value: string; } /** An input with copy abilities. */ diff --git a/src/components/display-name.tsx b/src/components/display-name.tsx index 9610ae8b6..bb6c8816b 100644 --- a/src/components/display-name.tsx +++ b/src/components/display-name.tsx @@ -11,9 +11,9 @@ import VerificationBadge from './verification-badge'; import type { Account } from 'soapbox/schemas'; interface IDisplayName { - account: Pick - withSuffix?: boolean - children?: React.ReactNode + account: Pick; + withSuffix?: boolean; + children?: React.ReactNode; } const DisplayName: React.FC = ({ account, children, withSuffix = true }) => { diff --git a/src/components/domain.tsx b/src/components/domain.tsx index 61470ced5..99ae9f50b 100644 --- a/src/components/domain.tsx +++ b/src/components/domain.tsx @@ -12,7 +12,7 @@ const messages = defineMessages({ }); interface IDomain { - domain: string + domain: string; } const Domain: React.FC = ({ domain }) => { diff --git a/src/components/dropdown-menu/dropdown-menu-item.tsx b/src/components/dropdown-menu/dropdown-menu-item.tsx index 0b27823d7..8c74e652a 100644 --- a/src/components/dropdown-menu/dropdown-menu-item.tsx +++ b/src/components/dropdown-menu/dropdown-menu-item.tsx @@ -5,23 +5,23 @@ import { useHistory } from 'react-router-dom'; import { Counter, Icon } from '../ui'; export interface MenuItem { - action?: React.EventHandler - active?: boolean - count?: number - destructive?: boolean - href?: string - icon?: string - meta?: string - middleClick?(event: React.MouseEvent): void - target?: React.HTMLAttributeAnchorTarget - text: string - to?: string + action?: React.EventHandler; + active?: boolean; + count?: number; + destructive?: boolean; + href?: string; + icon?: string; + meta?: string; + middleClick?(event: React.MouseEvent): void; + target?: React.HTMLAttributeAnchorTarget; + text: string; + to?: string; } interface IDropdownMenuItem { - index: number - item: MenuItem | null - onClick?(): void + index: number; + item: MenuItem | null; + onClick?(): void; } const DropdownMenuItem = ({ index, item, onClick }: IDropdownMenuItem) => { diff --git a/src/components/dropdown-menu/dropdown-menu.tsx b/src/components/dropdown-menu/dropdown-menu.tsx index 48fff7398..5af959cd7 100644 --- a/src/components/dropdown-menu/dropdown-menu.tsx +++ b/src/components/dropdown-menu/dropdown-menu.tsx @@ -18,16 +18,16 @@ import type { Status } from 'soapbox/types/entities'; export type Menu = Array; interface IDropdownMenu { - children?: React.ReactElement - disabled?: boolean - items: Menu - onClose?: () => void - onOpen?: () => void - onShiftClick?: React.EventHandler - placement?: Placement - src?: string - status?: Status - title?: string + children?: React.ReactElement; + disabled?: boolean; + items: Menu; + onClose?: () => void; + onOpen?: () => void; + onShiftClick?: React.EventHandler; + placement?: Placement; + src?: string; + status?: Status; + title?: string; } const listenerOptions = supportsPassiveEvents ? { passive: true } : false; diff --git a/src/components/error-boundary.tsx b/src/components/error-boundary.tsx index d6c3e9c28..8c45cea1e 100644 --- a/src/components/error-boundary.tsx +++ b/src/components/error-boundary.tsx @@ -27,14 +27,14 @@ const mapStateToProps = (state: RootState) => { }; interface Props extends ReturnType { - children: React.ReactNode + children: React.ReactNode; } type State = { - hasError: boolean - error: any - componentStack: any - browser?: Bowser.Parser.Parser + hasError: boolean; + error: any; + componentStack: any; + browser?: Bowser.Parser.Parser; } class ErrorBoundary extends React.PureComponent { diff --git a/src/components/event-preview.tsx b/src/components/event-preview.tsx index 9cfd1da81..4226bd5ca 100644 --- a/src/components/event-preview.tsx +++ b/src/components/event-preview.tsx @@ -19,10 +19,10 @@ const messages = defineMessages({ }); interface IEventPreview { - status: StatusEntity - className?: string - hideAction?: boolean - floatingAction?: boolean + status: StatusEntity; + className?: string; + hideAction?: boolean; + floatingAction?: boolean; } const EventPreview: React.FC = ({ status, className, hideAction, floatingAction = true }) => { diff --git a/src/components/extended-video-player.tsx b/src/components/extended-video-player.tsx index f31041bcf..e0512588c 100644 --- a/src/components/extended-video-player.tsx +++ b/src/components/extended-video-player.tsx @@ -3,14 +3,14 @@ import React, { useEffect, useRef } from 'react'; import { isIOS } from 'soapbox/is-mobile'; interface IExtendedVideoPlayer { - src: string - alt?: string - width?: number - height?: number - time?: number - controls?: boolean - muted?: boolean - onClick?: () => void + src: string; + alt?: string; + width?: number; + height?: number; + time?: number; + controls?: boolean; + muted?: boolean; + onClick?: () => void; } const ExtendedVideoPlayer: React.FC = ({ src, alt, time, controls, muted, onClick }) => { diff --git a/src/components/fork-awesome-icon.tsx b/src/components/fork-awesome-icon.tsx index 7a836da7b..09d5c8edb 100644 --- a/src/components/fork-awesome-icon.tsx +++ b/src/components/fork-awesome-icon.tsx @@ -9,9 +9,9 @@ import clsx from 'clsx'; import React from 'react'; export interface IForkAwesomeIcon extends React.HTMLAttributes { - id: string - className?: string - fixedWidth?: boolean + id: string; + className?: string; + fixedWidth?: boolean; } const ForkAwesomeIcon: React.FC = ({ id, className, fixedWidth, ...rest }) => { diff --git a/src/components/group-card.tsx b/src/components/group-card.tsx index 84e771902..e95914efa 100644 --- a/src/components/group-card.tsx +++ b/src/components/group-card.tsx @@ -11,7 +11,7 @@ import { HStack, Stack, Text } from './ui'; import type { Group as GroupEntity } from 'soapbox/types/entities'; interface IGroupCard { - group: GroupEntity + group: GroupEntity; } const GroupCard: React.FC = ({ group }) => { diff --git a/src/components/groups/group-avatar.tsx b/src/components/groups/group-avatar.tsx index 9b3213bb9..13b40d237 100644 --- a/src/components/groups/group-avatar.tsx +++ b/src/components/groups/group-avatar.tsx @@ -8,9 +8,9 @@ import { Avatar } from '../ui'; import type { Group } from 'soapbox/schemas'; interface IGroupAvatar { - group: Group - size: number - withRing?: boolean + group: Group; + size: number; + withRing?: boolean; } const GroupAvatar = (props: IGroupAvatar) => { diff --git a/src/components/groups/popover/group-popover.tsx b/src/components/groups/popover/group-popover.tsx index 245420af6..6aa214cd9 100644 --- a/src/components/groups/popover/group-popover.tsx +++ b/src/components/groups/popover/group-popover.tsx @@ -11,9 +11,9 @@ import GroupAvatar from '../group-avatar'; import type { Group } from 'soapbox/schemas'; interface IGroupPopoverContainer { - children: React.ReactElement> - isEnabled: boolean - group: Group + children: React.ReactElement>; + isEnabled: boolean; + group: Group; } const messages = defineMessages({ diff --git a/src/components/hashtag.tsx b/src/components/hashtag.tsx index 41b2c07a6..1963c4f04 100644 --- a/src/components/hashtag.tsx +++ b/src/components/hashtag.tsx @@ -10,7 +10,7 @@ import { HStack, Stack, Text } from './ui'; import type { Tag } from 'soapbox/types/entities'; interface IHashtag { - hashtag: Tag + hashtag: Tag; } const Hashtag: React.FC = ({ hashtag }) => { diff --git a/src/components/helmet.tsx b/src/components/helmet.tsx index c7eef876a..ee2ce3317 100644 --- a/src/components/helmet.tsx +++ b/src/components/helmet.tsx @@ -16,7 +16,7 @@ const getNotifTotals = (state: RootState): number => { }; interface IHelmet { - children: React.ReactNode + children: React.ReactNode; } const Helmet: React.FC = ({ children }) => { diff --git a/src/components/hoc/group-lookup-hoc.tsx b/src/components/hoc/group-lookup-hoc.tsx index 07c2d475b..570ec2e69 100644 --- a/src/components/hoc/group-lookup-hoc.tsx +++ b/src/components/hoc/group-lookup-hoc.tsx @@ -7,15 +7,15 @@ import { Layout } from '../ui'; interface IGroupLookup { params: { - groupSlug: string - } + groupSlug: string; + }; } interface IMaybeGroupLookup { params?: { - groupSlug?: string - groupId?: string - } + groupSlug?: string; + groupId?: string; + }; } function GroupLookupHoc(Component: React.ComponentType<{ params: { groupId: string } }>) { diff --git a/src/components/hover-ref-wrapper.tsx b/src/components/hover-ref-wrapper.tsx index d116e5d13..8d0aa1ecd 100644 --- a/src/components/hover-ref-wrapper.tsx +++ b/src/components/hover-ref-wrapper.tsx @@ -15,10 +15,10 @@ const showProfileHoverCard = debounce((dispatch, ref, accountId) => { }, 600); interface IHoverRefWrapper { - accountId: string - inline?: boolean - className?: string - children: React.ReactNode + accountId: string; + inline?: boolean; + className?: string; + children: React.ReactNode; } /** Makes a profile hover card appear when the wrapped element is hovered. */ diff --git a/src/components/hover-status-wrapper.tsx b/src/components/hover-status-wrapper.tsx index c2d2c4eda..685dbf3d9 100644 --- a/src/components/hover-status-wrapper.tsx +++ b/src/components/hover-status-wrapper.tsx @@ -14,10 +14,10 @@ const showStatusHoverCard = debounce((dispatch, ref, statusId) => { }, 300); interface IHoverStatusWrapper { - statusId: any - inline: boolean - className?: string - children: React.ReactNode + statusId: any; + inline: boolean; + className?: string; + children: React.ReactNode; } /** Makes a status hover card appear when the wrapped element is hovered. */ diff --git a/src/components/icon-button.tsx b/src/components/icon-button.tsx index f4da2c2c5..4eb0dccca 100644 --- a/src/components/icon-button.tsx +++ b/src/components/icon-button.tsx @@ -4,13 +4,13 @@ import React from 'react'; import Icon from 'soapbox/components/icon'; interface IIconButton extends Pick, 'className' | 'disabled' | 'onClick' | 'onKeyDown' | 'onKeyPress' | 'onKeyUp' | 'onMouseDown' | 'onMouseEnter' | 'onMouseLeave' | 'tabIndex' | 'title'> { - active?: boolean - expanded?: boolean - iconClassName?: string - pressed?: boolean - size?: number - src: string - text?: React.ReactNode + active?: boolean; + expanded?: boolean; + iconClassName?: string; + pressed?: boolean; + size?: number; + src: string; + text?: React.ReactNode; } const IconButton: React.FC = ({ diff --git a/src/components/icon-with-counter.tsx b/src/components/icon-with-counter.tsx index dbc17d9d2..5cac95290 100644 --- a/src/components/icon-with-counter.tsx +++ b/src/components/icon-with-counter.tsx @@ -4,10 +4,10 @@ import Icon, { IIcon } from 'soapbox/components/icon'; import { Counter } from 'soapbox/components/ui'; interface IIconWithCounter extends React.HTMLAttributes { - count: number - countMax?: number - icon?: string - src?: string + count: number; + countMax?: number; + icon?: string; + src?: string; } const IconWithCounter: React.FC = ({ icon, count, countMax, ...rest }) => { diff --git a/src/components/icon.tsx b/src/components/icon.tsx index 421d937dd..8ab8fe309 100644 --- a/src/components/icon.tsx +++ b/src/components/icon.tsx @@ -8,10 +8,10 @@ import React from 'react'; import InlineSVG from 'react-inlinesvg'; // eslint-disable-line no-restricted-imports export interface IIcon extends React.HTMLAttributes { - src: string - id?: string - alt?: string - className?: string + src: string; + id?: string; + alt?: string; + className?: string; } /** diff --git a/src/components/list.tsx b/src/components/list.tsx index 06a202535..303690593 100644 --- a/src/components/list.tsx +++ b/src/components/list.tsx @@ -8,7 +8,7 @@ import { SelectDropdown } from '../features/forms'; import { Icon, HStack, Select } from './ui'; interface IList { - children: React.ReactNode + children: React.ReactNode; } const List: React.FC = ({ children }) => ( @@ -16,13 +16,13 @@ const List: React.FC = ({ children }) => ( ); interface IListItem { - label: React.ReactNode - hint?: React.ReactNode - to?: string - onClick?(): void - onSelect?(): void - isSelected?: boolean - children?: React.ReactNode + label: React.ReactNode; + hint?: React.ReactNode; + to?: string; + onClick?(): void; + onSelect?(): void; + isSelected?: boolean; + children?: React.ReactNode; } const ListItem: React.FC = ({ label, hint, children, to, onClick, onSelect, isSelected }) => { diff --git a/src/components/load-gap.tsx b/src/components/load-gap.tsx index 2836fb14f..3ccdf4f81 100644 --- a/src/components/load-gap.tsx +++ b/src/components/load-gap.tsx @@ -8,9 +8,9 @@ const messages = defineMessages({ }); interface ILoadGap { - disabled?: boolean - maxId: string - onClick: (id: string) => void + disabled?: boolean; + maxId: string; + onClick: (id: string) => void; } const LoadGap: React.FC = ({ disabled, maxId, onClick }) => { diff --git a/src/components/load-more.tsx b/src/components/load-more.tsx index 878adda7c..c356751b9 100644 --- a/src/components/load-more.tsx +++ b/src/components/load-more.tsx @@ -4,10 +4,10 @@ import { FormattedMessage } from 'react-intl'; import { Button } from 'soapbox/components/ui'; interface ILoadMore { - onClick: React.MouseEventHandler - disabled?: boolean - visible?: boolean - className?: string + onClick: React.MouseEventHandler; + disabled?: boolean; + visible?: boolean; + className?: string; } const LoadMore: React.FC = ({ onClick, disabled, visible = true, className }) => { diff --git a/src/components/location-search.tsx b/src/components/location-search.tsx index df0622f2f..d2d8d4f29 100644 --- a/src/components/location-search.tsx +++ b/src/components/location-search.tsx @@ -18,7 +18,7 @@ const messages = defineMessages({ }); interface ILocationSearch { - onSelected: (locationId: string) => void + onSelected: (locationId: string) => void; } const LocationSearch: React.FC = ({ onSelected }) => { diff --git a/src/components/media-gallery.tsx b/src/components/media-gallery.tsx index 0c26b26f6..0d8e48683 100644 --- a/src/components/media-gallery.tsx +++ b/src/components/media-gallery.tsx @@ -19,21 +19,21 @@ const ATTACHMENT_LIMIT = 4; const MAX_FILENAME_LENGTH = 45; interface Dimensions { - w: Property.Width | number - h: Property.Height | number - t?: Property.Top - r?: Property.Right - b?: Property.Bottom - l?: Property.Left - float?: Property.Float - pos?: Property.Position + w: Property.Width | number; + h: Property.Height | number; + t?: Property.Top; + r?: Property.Right; + b?: Property.Bottom; + l?: Property.Left; + float?: Property.Float; + pos?: Property.Position; } interface SizeData { - style: React.CSSProperties - itemsDimensions: Dimensions[] - size: number - width: number + style: React.CSSProperties; + itemsDimensions: Dimensions[]; + size: number; + width: number; } const withinLimits = (aspectRatio: number) => { @@ -48,16 +48,16 @@ const shouldLetterbox = (attachment: Attachment): boolean => { }; interface IItem { - attachment: Attachment - standalone?: boolean - index: number - size: number - onClick: (index: number) => void - displayWidth?: number - visible: boolean - dimensions: Dimensions - last?: boolean - total: number + attachment: Attachment; + standalone?: boolean; + index: number; + size: number; + onClick: (index: number) => void; + displayWidth?: number; + visible: boolean; + dimensions: Dimensions; + last?: boolean; + total: number; } const Item: React.FC = ({ @@ -275,17 +275,17 @@ const Item: React.FC = ({ }; export interface IMediaGallery { - sensitive?: boolean - media: ImmutableList - height?: number - onOpenMedia: (media: ImmutableList, index: number) => void - defaultWidth?: number - cacheWidth?: (width: number) => void - visible?: boolean - onToggleVisibility?: () => void - displayMedia?: string - compact?: boolean - className?: string + sensitive?: boolean; + media: ImmutableList; + height?: number; + onOpenMedia: (media: ImmutableList, index: number) => void; + defaultWidth?: number; + cacheWidth?: (width: number) => void; + visible?: boolean; + onToggleVisibility?: () => void; + displayMedia?: string; + compact?: boolean; + className?: string; } const MediaGallery: React.FC = (props) => { diff --git a/src/components/missing-indicator.tsx b/src/components/missing-indicator.tsx index 02c383d01..69bade6c2 100644 --- a/src/components/missing-indicator.tsx +++ b/src/components/missing-indicator.tsx @@ -4,7 +4,7 @@ import { FormattedMessage } from 'react-intl'; import { Card, CardBody, Stack, Text } from './ui'; interface MissingIndicatorProps { - nested?: boolean + nested?: boolean; } const MissingIndicator = ({ nested = false }: MissingIndicatorProps): JSX.Element => ( diff --git a/src/components/modal-root.tsx b/src/components/modal-root.tsx index d8c8725a1..024f59ebc 100644 --- a/src/components/modal-root.tsx +++ b/src/components/modal-root.tsx @@ -37,10 +37,10 @@ export const checkEventComposeContent = (compose?: ReturnType void - onClose: (type?: ModalType) => void - type: ModalType - children: React.ReactNode + onCancel?: () => void; + onClose: (type?: ModalType) => void; + type: ModalType; + children: React.ReactNode; } const ModalRoot: React.FC = ({ children, onCancel, onClose, type }) => { diff --git a/src/components/navlinks.tsx b/src/components/navlinks.tsx index 4e0804326..4670f8015 100644 --- a/src/components/navlinks.tsx +++ b/src/components/navlinks.tsx @@ -5,7 +5,7 @@ import { Text } from 'soapbox/components/ui'; import { useSettings, useSoapboxConfig } from 'soapbox/hooks'; interface INavlinks { - type: string + type: string; } const Navlinks: React.FC = ({ type }) => { diff --git a/src/components/outline-box.tsx b/src/components/outline-box.tsx index 6994e6bd1..0f56c21ae 100644 --- a/src/components/outline-box.tsx +++ b/src/components/outline-box.tsx @@ -2,8 +2,8 @@ import clsx from 'clsx'; import React from 'react'; interface IOutlineBox extends React.HTMLAttributes { - children: React.ReactNode - className?: string + children: React.ReactNode; + className?: string; } /** Wraps children in a container with an outline. */ diff --git a/src/components/pending-items-row.tsx b/src/components/pending-items-row.tsx index 4fbf236cd..f86be15d3 100644 --- a/src/components/pending-items-row.tsx +++ b/src/components/pending-items-row.tsx @@ -7,11 +7,11 @@ import { HStack, Icon, Text } from 'soapbox/components/ui'; interface IPendingItemsRow { /** Path to navigate the user when clicked. */ - to: string + to: string; /** Number of pending items. */ - count: number + count: number; /** Size of the icon. */ - size?: 'md' | 'lg' + size?: 'md' | 'lg'; } const PendingItemsRow: React.FC = ({ to, count, size = 'md' }) => { diff --git a/src/components/polls/poll-footer.tsx b/src/components/polls/poll-footer.tsx index 1994c1e76..9df4215d0 100644 --- a/src/components/polls/poll-footer.tsx +++ b/src/components/polls/poll-footer.tsx @@ -16,9 +16,9 @@ const messages = defineMessages({ }); interface IPollFooter { - poll: PollEntity - showResults: boolean - selected: Selected + poll: PollEntity; + showResults: boolean; + selected: Selected; } const PollFooter: React.FC = ({ poll, showResults, selected }): JSX.Element => { diff --git a/src/components/polls/poll-option.tsx b/src/components/polls/poll-option.tsx index b4c37e11d..f27a81e64 100644 --- a/src/components/polls/poll-option.tsx +++ b/src/components/polls/poll-option.tsx @@ -15,7 +15,7 @@ const messages = defineMessages({ votes: { id: 'poll.votes', defaultMessage: '{votes, plural, one {# vote} other {# votes}}' }, }); -const PollPercentageBar: React.FC<{ percent: number, leading: boolean }> = ({ percent, leading }): JSX.Element => { +const PollPercentageBar: React.FC<{ percent: number; leading: boolean }> = ({ percent, leading }): JSX.Element => { return ( {({ width }) => ( @@ -29,7 +29,7 @@ const PollPercentageBar: React.FC<{ percent: number, leading: boolean }> = ({ pe }; interface IPollOptionText extends IPollOption { - percent: number + percent: number; } const PollOptionText: React.FC = ({ poll, option, index, active, onToggle }) => { @@ -95,12 +95,12 @@ const PollOptionText: React.FC = ({ poll, option, index, active }; interface IPollOption { - poll: PollEntity - option: PollOptionEntity - index: number - showResults?: boolean - active: boolean - onToggle: (value: number) => void + poll: PollEntity; + option: PollOptionEntity; + index: number; + showResults?: boolean; + active: boolean; + onToggle: (value: number) => void; } const PollOption: React.FC = (props): JSX.Element | null => { diff --git a/src/components/polls/poll.tsx b/src/components/polls/poll.tsx index a925e9597..45336a05c 100644 --- a/src/components/polls/poll.tsx +++ b/src/components/polls/poll.tsx @@ -13,8 +13,8 @@ import PollOption from './poll-option'; export type Selected = Record; interface IPoll { - id: string - status?: string + id: string; + status?: string; } const messages = defineMessages({ diff --git a/src/components/profile-hover-card.tsx b/src/components/profile-hover-card.tsx index 98b9f70e8..f7517430e 100644 --- a/src/components/profile-hover-card.tsx +++ b/src/components/profile-hover-card.tsx @@ -56,7 +56,7 @@ const handleMouseLeave = (dispatch: AppDispatch): React.MouseEventHandler => { }; interface IProfileHoverCard { - visible: boolean + visible: boolean; } /** Popup profile preview that appears when hovering avatars and display names. */ diff --git a/src/components/progress-circle.tsx b/src/components/progress-circle.tsx index af5bf396c..1adb3f46e 100644 --- a/src/components/progress-circle.tsx +++ b/src/components/progress-circle.tsx @@ -2,10 +2,10 @@ import clsx from 'clsx'; import React from 'react'; interface IProgressCircle { - progress: number - radius?: number - stroke?: number - title?: string + progress: number; + radius?: number; + stroke?: number; + title?: string; } const ProgressCircle: React.FC = ({ progress, radius = 12, stroke = 4, title }) => { diff --git a/src/components/pull-to-refresh.tsx b/src/components/pull-to-refresh.tsx index bf033eaa4..829441b37 100644 --- a/src/components/pull-to-refresh.tsx +++ b/src/components/pull-to-refresh.tsx @@ -4,10 +4,10 @@ import PTRComponent from 'react-simple-pull-to-refresh'; import { Spinner } from 'soapbox/components/ui'; interface IPullToRefresh { - onRefresh?: () => Promise - refreshingContent?: JSX.Element | string - pullingContent?: JSX.Element | string - children: React.ReactNode + onRefresh?: () => Promise; + refreshingContent?: JSX.Element | string; + pullingContent?: JSX.Element | string; + children: React.ReactNode; } /** diff --git a/src/components/pullable.tsx b/src/components/pullable.tsx index a8fe6afea..e92a76ea2 100644 --- a/src/components/pullable.tsx +++ b/src/components/pullable.tsx @@ -3,7 +3,7 @@ import React from 'react'; import PullToRefresh from './pull-to-refresh'; interface IPullable { - children: React.ReactNode + children: React.ReactNode; } /** diff --git a/src/components/quoted-status.tsx b/src/components/quoted-status.tsx index 065d41216..a5954eaa8 100644 --- a/src/components/quoted-status.tsx +++ b/src/components/quoted-status.tsx @@ -23,11 +23,11 @@ const messages = defineMessages({ interface IQuotedStatus { /** The quoted status entity. */ - status?: StatusEntity + status?: StatusEntity; /** Callback when cancelled (during compose). */ - onCancel?: Function + onCancel?: Function; /** Whether the status is shown in the post composer. */ - compose?: boolean + compose?: boolean; } /** Status embedded in a quote post. */ diff --git a/src/components/radio.tsx b/src/components/radio.tsx index f81412bb7..2104b9985 100644 --- a/src/components/radio.tsx +++ b/src/components/radio.tsx @@ -3,8 +3,8 @@ import React from 'react'; import List, { ListItem } from './list'; interface IRadioGroup { - onChange: React.ChangeEventHandler - children: React.ReactElement<{ onChange: React.ChangeEventHandler }>[] + onChange: React.ChangeEventHandler; + children: React.ReactElement<{ onChange: React.ChangeEventHandler }>[]; } const RadioGroup = ({ onChange, children }: IRadioGroup) => { @@ -16,11 +16,11 @@ const RadioGroup = ({ onChange, children }: IRadioGroup) => { }; interface IRadioItem { - label: React.ReactNode - hint?: React.ReactNode - value: string - checked: boolean - onChange?: React.ChangeEventHandler + label: React.ReactNode; + hint?: React.ReactNode; + value: string; + checked: boolean; + onChange?: React.ChangeEventHandler; } const RadioItem: React.FC = ({ label, hint, checked = false, onChange, value }) => { diff --git a/src/components/relative-timestamp.tsx b/src/components/relative-timestamp.tsx index 84e747146..c9b2780f2 100644 --- a/src/components/relative-timestamp.tsx +++ b/src/components/relative-timestamp.tsx @@ -113,14 +113,14 @@ const timeRemainingString = (intl: IntlShape, date: Date, now: number) => { }; interface RelativeTimestampProps extends IText { - intl: IntlShape - timestamp: string - year?: number - futureDate?: boolean + intl: IntlShape; + timestamp: string; + year?: number; + futureDate?: boolean; } interface RelativeTimestampState { - now: number + now: number; } /** Displays a timestamp compared to the current time, eg "1m" for one minute ago. */ diff --git a/src/components/safe-embed.tsx b/src/components/safe-embed.tsx index d77d0b3fa..3e2668648 100644 --- a/src/components/safe-embed.tsx +++ b/src/components/safe-embed.tsx @@ -2,13 +2,13 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'; interface ISafeEmbed { /** Styles for the outer frame element. */ - className?: string + className?: string; /** Space-separate list of restrictions to ALLOW for the iframe. */ - sandbox?: string + sandbox?: string; /** Unique title for the iframe. */ - title: string + title: string; /** HTML body to embed. */ - html?: string + html?: string; } /** Safely embeds arbitrary HTML content on the page (by putting it in an iframe). */ diff --git a/src/components/scroll-top-button.tsx b/src/components/scroll-top-button.tsx index 84f23969e..58d356c2a 100644 --- a/src/components/scroll-top-button.tsx +++ b/src/components/scroll-top-button.tsx @@ -7,15 +7,15 @@ import { useSettings } from 'soapbox/hooks'; interface IScrollTopButton { /** Callback when clicked, and also when scrolled to the top. */ - onClick: () => void + onClick: () => void; /** Number of unread items. */ - count: number + count: number; /** Message to display in the button (should contain a `{count}` value). */ - message: MessageDescriptor + message: MessageDescriptor; /** Distance from the top of the screen (scrolling down) before the button appears. */ - threshold?: number + threshold?: number; /** Distance from the top of the screen (scrolling up) before the action is triggered. */ - autoloadThreshold?: number + autoloadThreshold?: number; } /** Floating new post counter above timelines, clicked to scroll to top. */ diff --git a/src/components/scrollable-list.tsx b/src/components/scrollable-list.tsx index 78fb7f036..dd5fb7625 100644 --- a/src/components/scrollable-list.tsx +++ b/src/components/scrollable-list.tsx @@ -10,14 +10,14 @@ import { Card, Spinner } from './ui'; /** Custom Viruoso component context. */ type Context = { - itemClassName?: string - listClassName?: string + itemClassName?: string; + listClassName?: string; } /** Scroll position saved in sessionStorage. */ type SavedScrollPosition = { - index: number - offset: number + index: number; + offset: number; } /** Custom Virtuoso Item component representing a single scrollable item. */ @@ -37,48 +37,48 @@ const List: Components['List'] = React.forwardRef((props, interface IScrollableList extends VirtuosoProps { /** Unique key to preserve the scroll position when navigating back. */ - scrollKey?: string + scrollKey?: string; /** Pagination callback when the end of the list is reached. */ - onLoadMore?: () => void + onLoadMore?: () => void; /** Whether the data is currently being fetched. */ - isLoading?: boolean + isLoading?: boolean; /** Whether to actually display the loading state. */ - showLoading?: boolean + showLoading?: boolean; /** Whether we expect an additional page of data. */ - hasMore?: boolean + hasMore?: boolean; /** Additional element to display at the top of the list. */ - prepend?: React.ReactNode + prepend?: React.ReactNode; /** Whether to display the prepended element. */ - alwaysPrepend?: boolean + alwaysPrepend?: boolean; /** Message to display when the list is loaded but empty. */ - emptyMessage?: React.ReactNode + emptyMessage?: React.ReactNode; /** Should the empty message be displayed in a Card */ - emptyMessageCard?: boolean + emptyMessageCard?: boolean; /** Scrollable content. */ - children: Iterable + children: Iterable; /** Callback when the list is scrolled to the top. */ - onScrollToTop?: () => void + onScrollToTop?: () => void; /** Callback when the list is scrolled. */ - onScroll?: () => void + onScroll?: () => void; /** Placeholder component to render while loading. */ - placeholderComponent?: React.ComponentType | React.NamedExoticComponent + placeholderComponent?: React.ComponentType | React.NamedExoticComponent; /** Number of placeholders to render while loading. */ - placeholderCount?: number + placeholderCount?: number; /** * Pull to refresh callback. * @deprecated Put a PTR around the component instead. */ - onRefresh?: () => Promise + onRefresh?: () => Promise; /** Extra class names on the Virtuoso element. */ - className?: string + className?: string; /** Class names on each item container. */ - itemClassName?: string + itemClassName?: string; /** `id` attribute on the Virtuoso element. */ - id?: string + id?: string; /** CSS styles on the Virtuoso element. */ - style?: React.CSSProperties + style?: React.CSSProperties; /** Whether to use the window to scroll the content instead of Virtuoso's container. */ - useWindowScroll?: boolean + useWindowScroll?: boolean; } /** Legacy ScrollableList with Virtuoso for backwards-compatibility. */ diff --git a/src/components/sidebar-menu.tsx b/src/components/sidebar-menu.tsx index 819411133..8b1d43f1a 100644 --- a/src/components/sidebar-menu.tsx +++ b/src/components/sidebar-menu.tsx @@ -43,11 +43,11 @@ const messages = defineMessages({ }); interface ISidebarLink { - href?: string - to?: string - icon: string - text: string | JSX.Element - onClick: React.EventHandler + href?: string; + to?: string; + icon: string; + text: string | JSX.Element; + onClick: React.EventHandler; } const SidebarLink: React.FC = ({ href, to, icon, text, onClick }) => { diff --git a/src/components/sidebar-navigation-link.tsx b/src/components/sidebar-navigation-link.tsx index 108d4376c..224b75e06 100644 --- a/src/components/sidebar-navigation-link.tsx +++ b/src/components/sidebar-navigation-link.tsx @@ -6,17 +6,17 @@ import { Icon, Text } from './ui'; interface ISidebarNavigationLink { /** Notification count, if any. */ - count?: number + count?: number; /** Optional max to cap count (ie: N+) */ - countMax?: number + countMax?: number; /** URL to an SVG icon. */ - icon: string + icon: string; /** Link label. */ - text: React.ReactNode + text: React.ReactNode; /** Route to an internal page. */ - to?: string + to?: string; /** Callback when the link is clicked. */ - onClick?: React.EventHandler + onClick?: React.EventHandler; } /** Desktop sidebar navigation link. */ diff --git a/src/components/site-logo.tsx b/src/components/site-logo.tsx index 9d545a48d..10a769fad 100644 --- a/src/components/site-logo.tsx +++ b/src/components/site-logo.tsx @@ -5,9 +5,9 @@ import { useSoapboxConfig, useSettings, useTheme } from 'soapbox/hooks'; interface ISiteLogo extends React.ComponentProps<'img'> { /** Extra class names for the element. */ - className?: string + className?: string; /** Override theme setting for */ - theme?: 'dark' | 'light' + theme?: 'dark' | 'light'; } /** Display the most appropriate site logo based on the theme and configuration. */ diff --git a/src/components/status-action-bar.tsx b/src/components/status-action-bar.tsx index a42fac13b..8b2009b82 100644 --- a/src/components/status-action-bar.tsx +++ b/src/components/status-action-bar.tsx @@ -108,11 +108,11 @@ const messages = defineMessages({ }); interface IStatusActionBar { - status: Status - withLabels?: boolean - expandable?: boolean - space?: 'sm' | 'md' | 'lg' - statusActionButtonTheme?: 'default' | 'inverse' + status: Status; + withLabels?: boolean; + expandable?: boolean; + space?: 'sm' | 'md' | 'lg'; + statusActionButtonTheme?: 'default' | 'inverse'; } const StatusActionBar: React.FC = ({ @@ -698,7 +698,7 @@ const StatusActionBar: React.FC = ({ const canShare = ('share' in navigator) && (status.visibility === 'public' || status.visibility === 'group'); const spacing: { - [key: string]: React.ComponentProps['space'] + [key: string]: React.ComponentProps['space']; } = { 'sm': 2, 'md': 8, diff --git a/src/components/status-action-button.tsx b/src/components/status-action-button.tsx index 10f952065..3dfe61939 100644 --- a/src/components/status-action-button.tsx +++ b/src/components/status-action-button.tsx @@ -14,7 +14,7 @@ const COLORS = { type Color = keyof typeof COLORS; interface IStatusActionCounter { - count: number + count: number; } /** Action button numerical counter, eg "5" likes. */ @@ -27,15 +27,15 @@ const StatusActionCounter: React.FC = ({ count = 0 }): JSX }; interface IStatusActionButton extends React.ButtonHTMLAttributes { - iconClassName?: string - icon: string - count?: number - active?: boolean - color?: Color - filled?: boolean - emoji?: ImmutableMap - text?: React.ReactNode - theme?: 'default' | 'inverse' + iconClassName?: string; + icon: string; + count?: number; + active?: boolean; + color?: Color; + filled?: boolean; + emoji?: ImmutableMap; + text?: React.ReactNode; + theme?: 'default' | 'inverse'; } const StatusActionButton = React.forwardRef((props, ref): JSX.Element => { diff --git a/src/components/status-content.tsx b/src/components/status-content.tsx index 5fc530769..7c322dcb8 100644 --- a/src/components/status-content.tsx +++ b/src/components/status-content.tsx @@ -18,7 +18,7 @@ const MAX_HEIGHT = 642; // 20px * 32 (+ 2px padding at the top) const BIG_EMOJI_LIMIT = 10; interface IReadMoreButton { - onClick: React.MouseEventHandler + onClick: React.MouseEventHandler; } /** Button to expand a truncated status (due to too much content) */ @@ -30,11 +30,11 @@ const ReadMoreButton: React.FC = ({ onClick }) => ( ); interface IStatusContent { - status: Status - onClick?: () => void - collapsable?: boolean - translatable?: boolean - textSize?: Sizes + status: Status; + onClick?: () => void; + collapsable?: boolean; + translatable?: boolean; + textSize?: Sizes; } /** Renders the text content of a status */ diff --git a/src/components/status-hover-card.tsx b/src/components/status-hover-card.tsx index 4f91bff4e..5c31f9b4d 100644 --- a/src/components/status-hover-card.tsx +++ b/src/components/status-hover-card.tsx @@ -15,7 +15,7 @@ import { showStatusHoverCard } from './hover-status-wrapper'; import { Card, CardBody } from './ui'; interface IStatusHoverCard { - visible: boolean + visible: boolean; } /** Popup status preview that appears when hovering reply to */ diff --git a/src/components/status-list.tsx b/src/components/status-list.tsx index d1f6164c3..4f6347593 100644 --- a/src/components/status-list.tsx +++ b/src/components/status-list.tsx @@ -17,31 +17,31 @@ import type { IScrollableList } from 'soapbox/components/scrollable-list'; interface IStatusList extends Omit { /** Unique key to preserve the scroll position when navigating back. */ - scrollKey: string + scrollKey: string; /** List of status IDs to display. */ - statusIds: ImmutableOrderedSet + statusIds: ImmutableOrderedSet; /** Last _unfiltered_ status ID (maxId) for pagination. */ - lastStatusId?: string + lastStatusId?: string; /** Pinned statuses to show at the top of the feed. */ - featuredStatusIds?: ImmutableOrderedSet + featuredStatusIds?: ImmutableOrderedSet; /** Pagination callback when the end of the list is reached. */ - onLoadMore?: (lastStatusId: string) => void + onLoadMore?: (lastStatusId: string) => void; /** Whether the data is currently being fetched. */ - isLoading: boolean + isLoading: boolean; /** Whether the server did not return a complete page. */ - isPartial?: boolean + isPartial?: boolean; /** Whether we expect an additional page of data. */ - hasMore: boolean + hasMore: boolean; /** Message to display when the list is loaded but empty. */ - emptyMessage: React.ReactNode + emptyMessage: React.ReactNode; /** ID of the timeline in Redux. */ - timelineId?: string + timelineId?: string; /** Whether to display a gap or border between statuses in the list. */ - divideType?: 'space' | 'border' + divideType?: 'space' | 'border'; /** Whether to display ads. */ - showAds?: boolean + showAds?: boolean; /** Whether to show group information. */ - showGroup?: boolean + showGroup?: boolean; } /** Feed of statuses, built atop ScrollableList. */ diff --git a/src/components/status-media.tsx b/src/components/status-media.tsx index 99329f297..00975e224 100644 --- a/src/components/status-media.tsx +++ b/src/components/status-media.tsx @@ -15,15 +15,15 @@ import type { Status, Attachment } from 'soapbox/types/entities'; interface IStatusMedia { /** Status entity to render media for. */ - status: Status + status: Status; /** Whether to display compact media. */ - muted?: boolean + muted?: boolean; /** Callback when compact media is clicked. */ - onClick?: () => void + onClick?: () => void; /** Whether or not the media is concealed behind a NSFW banner. */ - showMedia?: boolean + showMedia?: boolean; /** Callback when visibility is toggled (eg clicked through NSFW). */ - onToggleVisibility?: () => void + onToggleVisibility?: () => void; } /** Render media attachments for a status. */ diff --git a/src/components/status-reaction-wrapper.tsx b/src/components/status-reaction-wrapper.tsx index 236653307..f8e6129d1 100644 --- a/src/components/status-reaction-wrapper.tsx +++ b/src/components/status-reaction-wrapper.tsx @@ -8,8 +8,8 @@ import { isUserTouching } from 'soapbox/is-mobile'; import { getReactForStatus } from 'soapbox/utils/emoji-reacts'; interface IStatusReactionWrapper { - statusId: string - children: JSX.Element + statusId: string; + children: JSX.Element; } /** Provides emoji reaction functionality to the underlying button component */ diff --git a/src/components/status-reply-mentions.tsx b/src/components/status-reply-mentions.tsx index e03d0c7f7..2b8e8633d 100644 --- a/src/components/status-reply-mentions.tsx +++ b/src/components/status-reply-mentions.tsx @@ -11,8 +11,8 @@ import { isPubkey } from 'soapbox/utils/nostr'; import type { Account, Status } from 'soapbox/types/entities'; interface IStatusReplyMentions { - status: Status - hoverable?: boolean + status: Status; + hoverable?: boolean; } const StatusReplyMentions: React.FC = ({ status, hoverable = true }) => { diff --git a/src/components/status.tsx b/src/components/status.tsx index d3ef12c1d..c2411e6dc 100644 --- a/src/components/status.tsx +++ b/src/components/status.tsx @@ -30,29 +30,29 @@ import type { } from 'soapbox/types/entities'; // Defined in components/scrollable-list -export type ScrollPosition = { height: number, top: number }; +export type ScrollPosition = { height: number; top: number }; const messages = defineMessages({ reblogged_by: { id: 'status.reblogged_by', defaultMessage: '{name} reposted' }, }); export interface IStatus { - id?: string - avatarSize?: number - status: StatusEntity - onClick?: () => void - muted?: boolean - hidden?: boolean - unread?: boolean - onMoveUp?: (statusId: string, featured?: boolean) => void - onMoveDown?: (statusId: string, featured?: boolean) => void - focusable?: boolean - featured?: boolean - hideActionBar?: boolean - hoverable?: boolean - variant?: 'default' | 'rounded' | 'slim' - showGroup?: boolean - accountAction?: React.ReactElement + id?: string; + avatarSize?: number; + status: StatusEntity; + onClick?: () => void; + muted?: boolean; + hidden?: boolean; + unread?: boolean; + onMoveUp?: (statusId: string, featured?: boolean) => void; + onMoveDown?: (statusId: string, featured?: boolean) => void; + focusable?: boolean; + featured?: boolean; + hideActionBar?: boolean; + hoverable?: boolean; + variant?: 'default' | 'rounded' | 'slim'; + showGroup?: boolean; + accountAction?: React.ReactElement; } const Status: React.FC = (props) => { diff --git a/src/components/statuses/sensitive-content-overlay.tsx b/src/components/statuses/sensitive-content-overlay.tsx index bf5dc7d82..dabb23318 100644 --- a/src/components/statuses/sensitive-content-overlay.tsx +++ b/src/components/statuses/sensitive-content-overlay.tsx @@ -27,9 +27,9 @@ const messages = defineMessages({ }); interface ISensitiveContentOverlay { - status: StatusEntity - onToggleVisibility?(): void - visible?: boolean + status: StatusEntity; + onToggleVisibility?(): void; + visible?: boolean; } const SensitiveContentOverlay = React.forwardRef((props, ref) => { diff --git a/src/components/statuses/status-info.tsx b/src/components/statuses/status-info.tsx index 50fad86b3..619ee5afd 100644 --- a/src/components/statuses/status-info.tsx +++ b/src/components/statuses/status-info.tsx @@ -3,9 +3,9 @@ import React from 'react'; import { HStack, Text } from '../ui'; interface IStatusInfo { - avatarSize: number - icon: React.ReactNode - text: React.ReactNode + avatarSize: number; + icon: React.ReactNode; + text: React.ReactNode; } const StatusInfo = (props: IStatusInfo) => { diff --git a/src/components/still-image.tsx b/src/components/still-image.tsx index 4a3caf01e..68647ff23 100644 --- a/src/components/still-image.tsx +++ b/src/components/still-image.tsx @@ -5,19 +5,19 @@ import { useSettings } from 'soapbox/hooks'; export interface IStillImage { /** Image alt text. */ - alt?: string + alt?: string; /** Extra class names for the outer
container. */ - className?: string + className?: string; /** URL to the image */ - src: string + src: string; /** Extra CSS styles on the outer
element. */ - style?: React.CSSProperties + style?: React.CSSProperties; /** Whether to display the image contained vs filled in its container. */ - letterboxed?: boolean + letterboxed?: boolean; /** Whether to show the file extension in the corner. */ - showExt?: boolean + showExt?: boolean; /** Callback function if the image fails to load */ - onError?(): void + onError?(): void; } /** Renders images on a canvas, only playing GIFs if autoPlayGif is enabled. */ @@ -83,7 +83,7 @@ const StillImage: React.FC = ({ alt, className, src, style, letterb interface IExtensionBadge { /** File extension. */ - ext: string + ext: string; } /** Badge displaying a file extension. */ diff --git a/src/components/thumb-navigation-link.tsx b/src/components/thumb-navigation-link.tsx index 46c3ae4a7..d7d8cd681 100644 --- a/src/components/thumb-navigation-link.tsx +++ b/src/components/thumb-navigation-link.tsx @@ -6,13 +6,13 @@ import IconWithCounter from 'soapbox/components/icon-with-counter'; import { Icon, Text } from 'soapbox/components/ui'; interface IThumbNavigationLink { - count?: number - countMax?: number - src: string - text: string | React.ReactElement - to: string - exact?: boolean - paths?: Array + count?: number; + countMax?: number; + src: string; + text: string | React.ReactElement; + to: string; + exact?: boolean; + paths?: Array; } const ThumbNavigationLink: React.FC = ({ count, countMax, src, text, to, exact, paths }): JSX.Element => { diff --git a/src/components/tombstone.tsx b/src/components/tombstone.tsx index e8efe24c7..faaa84ee0 100644 --- a/src/components/tombstone.tsx +++ b/src/components/tombstone.tsx @@ -5,9 +5,9 @@ import { Text } from 'soapbox/components/ui'; import { HotKeys } from 'soapbox/features/ui/components/hotkeys'; interface ITombstone { - id: string - onMoveUp?: (statusId: string) => void - onMoveDown?: (statusId: string) => void + id: string; + onMoveUp?: (statusId: string) => void; + onMoveDown?: (statusId: string) => void; } /** Represents a deleted item. */ diff --git a/src/components/translate-button.tsx b/src/components/translate-button.tsx index f330cad5e..e74b9b82a 100644 --- a/src/components/translate-button.tsx +++ b/src/components/translate-button.tsx @@ -10,7 +10,7 @@ import { Stack, Button, Text } from './ui'; import type { Account, Status } from 'soapbox/types/entities'; interface ITranslateButton { - status: Status + status: Status; } const TranslateButton: React.FC = ({ status }) => { diff --git a/src/components/ui/accordion/accordion.tsx b/src/components/ui/accordion/accordion.tsx index 842032242..f415dac08 100644 --- a/src/components/ui/accordion/accordion.tsx +++ b/src/components/ui/accordion/accordion.tsx @@ -16,14 +16,14 @@ const messages = defineMessages({ }); interface IAccordion { - headline: React.ReactNode - children?: React.ReactNode - menu?: Menu - expanded?: boolean - onToggle?: (value: boolean) => void - action?: () => void - actionIcon?: string - actionLabel?: string + headline: React.ReactNode; + children?: React.ReactNode; + menu?: Menu; + expanded?: boolean; + onToggle?: (value: boolean) => void; + action?: () => void; + actionIcon?: string; + actionLabel?: string; } /** diff --git a/src/components/ui/avatar/avatar.tsx b/src/components/ui/avatar/avatar.tsx index 762939776..d00f8ebf2 100644 --- a/src/components/ui/avatar/avatar.tsx +++ b/src/components/ui/avatar/avatar.tsx @@ -9,7 +9,7 @@ const AVATAR_SIZE = 42; interface IAvatar extends Pick { /** Width and height of the avatar in pixels. */ - size?: number + size?: number; } /** Round profile avatar for accounts. */ diff --git a/src/components/ui/banner/banner.tsx b/src/components/ui/banner/banner.tsx index da6f7ed03..c0d489fe8 100644 --- a/src/components/ui/banner/banner.tsx +++ b/src/components/ui/banner/banner.tsx @@ -2,9 +2,9 @@ import clsx from 'clsx'; import React from 'react'; interface IBanner { - theme: 'frosted' | 'opaque' - children: React.ReactNode - className?: string + theme: 'frosted' | 'opaque'; + children: React.ReactNode; + className?: string; } /** Displays a sticky full-width banner at the bottom of the screen. */ diff --git a/src/components/ui/button/button.tsx b/src/components/ui/button/button.tsx index e06ffa7d1..412717d3c 100644 --- a/src/components/ui/button/button.tsx +++ b/src/components/ui/button/button.tsx @@ -10,27 +10,27 @@ import type { ButtonSizes, ButtonThemes } from './useButtonStyles'; interface IButton { /** Whether this button expands the width of its container. */ - block?: boolean + block?: boolean; /** Elements inside the