diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 51cc6e833..953c7e252 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -260,12 +260,29 @@ module.exports = { }, ], '@typescript-eslint/no-duplicate-imports': 'error', + '@typescript-eslint/member-delimiter-style': [ + 'error', + { + multiline: { + delimiter: 'none', + }, + singleline: { + delimiter: 'comma', + }, + }, + ], 'promise/catch-or-return': 'error', 'react-hooks/rules-of-hooks': 'error', - 'tailwindcss/classnames-order': 'error', + 'tailwindcss/classnames-order': [ + 'error', + { + classRegex: '^(base|container|icon|item|list|outer|wrapper)?[c|C]lass(Name)?$', + config: 'tailwind.config.cjs', + }, + ], 'tailwindcss/migration-from-tailwind-2': 'error', }, overrides: [ diff --git a/app/soapbox/actions/accounts.ts b/app/soapbox/actions/accounts.ts index b4a54201f..a389e29cd 100644 --- a/app/soapbox/actions/accounts.ts +++ b/app/soapbox/actions/accounts.ts @@ -228,7 +228,7 @@ const fetchAccountFail = (id: string | null, error: AxiosError) => ({ }); type FollowAccountOpts = { - reblogs?: boolean, + reblogs?: boolean notify?: boolean }; diff --git a/app/soapbox/actions/export-data.ts b/app/soapbox/actions/export-data.ts index 1ddab9103..519725ea2 100644 --- a/app/soapbox/actions/export-data.ts +++ b/app/soapbox/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/app/soapbox/actions/familiar-followers.ts b/app/soapbox/actions/familiar-followers.ts index ec6eca6d8..2d8aa6786 100644 --- a/app/soapbox/actions/familiar-followers.ts +++ b/app/soapbox/actions/familiar-followers.ts @@ -11,25 +11,25 @@ export const FAMILIAR_FOLLOWERS_FETCH_SUCCESS = 'FAMILIAR_FOLLOWERS_FETCH_SUCCES export const FAMILIAR_FOLLOWERS_FETCH_FAIL = 'FAMILIAR_FOLLOWERS_FETCH_FAIL'; type FamiliarFollowersFetchRequestAction = { - type: typeof FAMILIAR_FOLLOWERS_FETCH_REQUEST, - id: string, + type: typeof FAMILIAR_FOLLOWERS_FETCH_REQUEST + id: string } type FamiliarFollowersFetchRequestSuccessAction = { - type: typeof FAMILIAR_FOLLOWERS_FETCH_SUCCESS, - id: string, - accounts: Array, + type: typeof FAMILIAR_FOLLOWERS_FETCH_SUCCESS + id: string + accounts: Array } type FamiliarFollowersFetchRequestFailAction = { - type: typeof FAMILIAR_FOLLOWERS_FETCH_FAIL, - id: string, - error: any, + type: typeof FAMILIAR_FOLLOWERS_FETCH_FAIL + id: string + error: any } type AccountsImportAction = { - type: typeof ACCOUNTS_IMPORT, - accounts: Array, + type: typeof ACCOUNTS_IMPORT + accounts: Array } export type FamiliarFollowersActions = FamiliarFollowersFetchRequestAction | FamiliarFollowersFetchRequestSuccessAction | FamiliarFollowersFetchRequestFailAction | AccountsImportAction diff --git a/app/soapbox/actions/import-data.ts b/app/soapbox/actions/import-data.ts index 90f81e7e7..023529453 100644 --- a/app/soapbox/actions/import-data.ts +++ b/app/soapbox/actions/import-data.ts @@ -27,8 +27,8 @@ type ImportDataActions = { | typeof IMPORT_BLOCKS_FAIL | typeof IMPORT_MUTES_REQUEST | typeof IMPORT_MUTES_SUCCESS - | typeof IMPORT_MUTES_FAIL, - error?: any, + | typeof IMPORT_MUTES_FAIL + error?: any config?: string } diff --git a/app/soapbox/actions/push-notifications/registerer.ts b/app/soapbox/actions/push-notifications/registerer.ts index 3a9d4fb9e..2ea7fbab8 100644 --- a/app/soapbox/actions/push-notifications/registerer.ts +++ b/app/soapbox/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/app/soapbox/actions/reports.ts b/app/soapbox/actions/reports.ts index 46b51cd55..d6a24a8c8 100644 --- a/app/soapbox/actions/reports.ts +++ b/app/soapbox/actions/reports.ts @@ -21,7 +21,7 @@ const REPORT_BLOCK_CHANGE = 'REPORT_BLOCK_CHANGE'; const REPORT_RULE_CHANGE = 'REPORT_RULE_CHANGE'; type ReportedEntity = { - status?: Status, + status?: Status chatMessage?: ChatMessage } diff --git a/app/soapbox/actions/settings.ts b/app/soapbox/actions/settings.ts index 5f4a600d2..79ffe1975 100644 --- a/app/soapbox/actions/settings.ts +++ b/app/soapbox/actions/settings.ts @@ -18,7 +18,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 messages = defineMessages({ diff --git a/app/soapbox/actions/streaming.ts b/app/soapbox/actions/streaming.ts index a02b3c1d7..c9095e021 100644 --- a/app/soapbox/actions/streaming.ts +++ b/app/soapbox/actions/streaming.ts @@ -81,7 +81,7 @@ const updateChatQuery = (chat: IChat) => { }; interface StreamOpts { - statContext?: IStatContext, + statContext?: IStatContext } const connectTimelineStream = ( diff --git a/app/soapbox/actions/verification.ts b/app/soapbox/actions/verification.ts index d038a79a9..2273bb499 100644 --- a/app/soapbox/actions/verification.ts +++ b/app/soapbox/actions/verification.ts @@ -31,14 +31,14 @@ const AGE: Challenge = 'age'; export type Challenge = 'age' | 'sms' | 'email' type Challenges = { - email?: 0 | 1, - sms?: 0 | 1, - age?: 0 | 1, + email?: 0 | 1 + sms?: 0 | 1 + age?: 0 | 1 } type Verification = { - token?: string, - challenges?: Challenges, + token?: string + challenges?: Challenges challengeTypes?: Array<'age' | 'sms' | 'email'> }; diff --git a/app/soapbox/components/__mocks__/react-inlinesvg.tsx b/app/soapbox/components/__mocks__/react-inlinesvg.tsx index 1d4fde154..1317dcbcb 100644 --- a/app/soapbox/components/__mocks__/react-inlinesvg.tsx +++ b/app/soapbox/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/app/soapbox/components/account-search.tsx b/app/soapbox/components/account-search.tsx index f69845dd3..cbaab0f18 100644 --- a/app/soapbox/components/account-search.tsx +++ b/app/soapbox/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/app/soapbox/components/account.tsx b/app/soapbox/components/account.tsx index 069cde252..ec882f060 100644 --- a/app/soapbox/components/account.tsx +++ b/app/soapbox/components/account.tsx @@ -17,8 +17,8 @@ import type { StatusApprovalStatus } from 'soapbox/normalizers/status'; import type { Account as AccountEntity } from 'soapbox/types/entities'; interface IInstanceFavicon { - account: AccountEntity, - disabled?: boolean, + account: AccountEntity + disabled?: boolean } const messages = defineMessages({ @@ -53,7 +53,7 @@ const InstanceFavicon: React.FC = ({ account, disabled }) => { }; interface IProfilePopper { - condition: boolean, + condition: boolean wrapper: (children: React.ReactNode) => React.ReactNode children: React.ReactNode } @@ -67,30 +67,30 @@ const ProfilePopper: React.FC = ({ condition, wrapper, children }; export interface IAccount { - account: AccountEntity, - action?: React.ReactElement, - actionAlignment?: 'center' | 'top', - actionIcon?: string, - actionTitle?: string, + account: AccountEntity + 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, - 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 + note?: string } const Account = ({ @@ -143,7 +143,7 @@ const Account = ({ title={actionTitle} onClick={handleAction} className='bg-transparent text-gray-600 hover:text-gray-700 dark:text-gray-600 dark:hover:text-gray-500' - iconClassName='w-4 h-4' + iconClassName='h-4 w-4' /> ); } diff --git a/app/soapbox/components/animated-number.tsx b/app/soapbox/components/animated-number.tsx index e7dd82462..199a8b4db 100644 --- a/app/soapbox/components/animated-number.tsx +++ b/app/soapbox/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/app/soapbox/components/announcements/announcement-content.tsx b/app/soapbox/components/announcements/announcement-content.tsx index f4265d1fd..459f88e64 100644 --- a/app/soapbox/components/announcements/announcement-content.tsx +++ b/app/soapbox/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/app/soapbox/components/announcements/announcement.tsx b/app/soapbox/components/announcements/announcement.tsx index ea96b37fd..62d5a1170 100644 --- a/app/soapbox/components/announcements/announcement.tsx +++ b/app/soapbox/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/app/soapbox/components/announcements/emoji.tsx b/app/soapbox/components/announcements/emoji.tsx index 3628227df..ecc28fcf8 100644 --- a/app/soapbox/components/announcements/emoji.tsx +++ b/app/soapbox/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/app/soapbox/components/announcements/reaction.tsx b/app/soapbox/components/announcements/reaction.tsx index edcdc5206..c5ea60212 100644 --- a/app/soapbox/components/announcements/reaction.tsx +++ b/app/soapbox/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/app/soapbox/components/announcements/reactions-bar.tsx b/app/soapbox/components/announcements/reactions-bar.tsx index 566d8a106..ebe651056 100644 --- a/app/soapbox/components/announcements/reactions-bar.tsx +++ b/app/soapbox/components/announcements/reactions-bar.tsx @@ -13,11 +13,11 @@ import type { Emoji } from 'soapbox/components/autosuggest-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/app/soapbox/components/autosuggest-account-input.tsx b/app/soapbox/components/autosuggest-account-input.tsx index 383bf7583..d191aec15 100644 --- a/app/soapbox/components/autosuggest-account-input.tsx +++ b/app/soapbox/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/app/soapbox/components/autosuggest-emoji.tsx b/app/soapbox/components/autosuggest-emoji.tsx index 7074605a2..9893fa345 100644 --- a/app/soapbox/components/autosuggest-emoji.tsx +++ b/app/soapbox/components/autosuggest-emoji.tsx @@ -4,19 +4,19 @@ import unicodeMapping from 'soapbox/features/emoji/emoji-unicode-mapping-light'; import { joinPublicPath } from 'soapbox/utils/static'; export type Emoji = { - id: string, - custom: boolean, - imageUrl: string, - native: string, - colons: string, + id: string + custom: boolean + imageUrl: string + native: string + colons: string } type UnicodeMapping = { - filename: string, + filename: string } interface IAutosuggestEmoji { - emoji: Emoji, + emoji: Emoji } const AutosuggestEmoji: React.FC = ({ emoji }) => { diff --git a/app/soapbox/components/autosuggest-input.tsx b/app/soapbox/components/autosuggest-input.tsx index 5213e3585..dba457ee8 100644 --- a/app/soapbox/components/autosuggest-input.tsx +++ b/app/soapbox/components/autosuggest-input.tsx @@ -16,23 +16,23 @@ import type { InputThemes } from 'soapbox/components/ui/input/input'; 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/app/soapbox/components/autosuggest-location.tsx b/app/soapbox/components/autosuggest-location.tsx index fab4493c9..23ea09807 100644 --- a/app/soapbox/components/autosuggest-location.tsx +++ b/app/soapbox/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/app/soapbox/components/autosuggest-textarea.tsx b/app/soapbox/components/autosuggest-textarea.tsx index 008bb9f81..df791d91a 100644 --- a/app/soapbox/components/autosuggest-textarea.tsx +++ b/app/soapbox/components/autosuggest-textarea.tsx @@ -14,23 +14,23 @@ import AutosuggestEmoji, { Emoji } from './autosuggest-emoji'; import type { List as ImmutableList } from 'immutable'; 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/app/soapbox/components/badge.tsx b/app/soapbox/components/badge.tsx index 56e1d32d7..fac7487e0 100644 --- a/app/soapbox/components/badge.tsx +++ b/app/soapbox/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/app/soapbox/components/birthday-input.tsx b/app/soapbox/components/birthday-input.tsx index 3be57348a..0d21ed287 100644 --- a/app/soapbox/components/birthday-input.tsx +++ b/app/soapbox/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/app/soapbox/components/blurhash.tsx b/app/soapbox/components/blurhash.tsx index cdf5cbf9e..d0e0f43b9 100644 --- a/app/soapbox/components/blurhash.tsx +++ b/app/soapbox/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/app/soapbox/components/copyable-input.tsx b/app/soapbox/components/copyable-input.tsx index a8175fe3f..57f4db55d 100644 --- a/app/soapbox/components/copyable-input.tsx +++ b/app/soapbox/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/app/soapbox/components/domain.tsx b/app/soapbox/components/domain.tsx index 117b94120..61470ced5 100644 --- a/app/soapbox/components/domain.tsx +++ b/app/soapbox/components/domain.tsx @@ -12,7 +12,7 @@ const messages = defineMessages({ }); interface IDomain { - domain: string, + domain: string } const Domain: React.FC = ({ domain }) => { diff --git a/app/soapbox/components/error-boundary.tsx b/app/soapbox/components/error-boundary.tsx index 3a6b4ac0b..4ab76e46d 100644 --- a/app/soapbox/components/error-boundary.tsx +++ b/app/soapbox/components/error-boundary.tsx @@ -31,10 +31,10 @@ interface Props extends ReturnType { } 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/app/soapbox/components/extended-video-player.tsx b/app/soapbox/components/extended-video-player.tsx index ec7e7f3f4..f31041bcf 100644 --- a/app/soapbox/components/extended-video-player.tsx +++ b/app/soapbox/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/app/soapbox/components/fork-awesome-icon.tsx b/app/soapbox/components/fork-awesome-icon.tsx index a4e268b24..7a836da7b 100644 --- a/app/soapbox/components/fork-awesome-icon.tsx +++ b/app/soapbox/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/app/soapbox/components/hashtag.tsx b/app/soapbox/components/hashtag.tsx index 41267d19c..8dc74230e 100644 --- a/app/soapbox/components/hashtag.tsx +++ b/app/soapbox/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/app/soapbox/components/hover-ref-wrapper.tsx b/app/soapbox/components/hover-ref-wrapper.tsx index 8a9d0adec..d116e5d13 100644 --- a/app/soapbox/components/hover-ref-wrapper.tsx +++ b/app/soapbox/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/app/soapbox/components/hover-status-wrapper.tsx b/app/soapbox/components/hover-status-wrapper.tsx index 0176bf41f..c2d2c4eda 100644 --- a/app/soapbox/components/hover-status-wrapper.tsx +++ b/app/soapbox/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/app/soapbox/components/icon-with-counter.tsx b/app/soapbox/components/icon-with-counter.tsx index 95e1060d8..b244f932b 100644 --- a/app/soapbox/components/icon-with-counter.tsx +++ b/app/soapbox/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, + count: number countMax?: number - icon?: string; - src?: string; + icon?: string + src?: string } const IconWithCounter: React.FC = ({ icon, count, countMax, ...rest }) => { diff --git a/app/soapbox/components/icon.tsx b/app/soapbox/components/icon.tsx index 5239bc46b..300265ea5 100644 --- a/app/soapbox/components/icon.tsx +++ b/app/soapbox/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 } const Icon: React.FC = ({ src, alt, className, ...rest }) => { diff --git a/app/soapbox/components/list.tsx b/app/soapbox/components/list.tsx index 4dd1f85b7..3dd77c34c 100644 --- a/app/soapbox/components/list.tsx +++ b/app/soapbox/components/list.tsx @@ -16,9 +16,9 @@ const List: React.FC = ({ children }) => ( ); interface IListItem { - label: React.ReactNode, - hint?: React.ReactNode, - onClick?(): void, + label: React.ReactNode + hint?: React.ReactNode + onClick?(): void onSelect?(): void isSelected?: boolean children?: React.ReactNode diff --git a/app/soapbox/components/load-gap.tsx b/app/soapbox/components/load-gap.tsx index c26da0281..2836fb14f 100644 --- a/app/soapbox/components/load-gap.tsx +++ b/app/soapbox/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/app/soapbox/components/load-more.tsx b/app/soapbox/components/load-more.tsx index e36ae116f..e937965fd 100644 --- a/app/soapbox/components/load-more.tsx +++ b/app/soapbox/components/load-more.tsx @@ -4,9 +4,9 @@ import { FormattedMessage } from 'react-intl'; import { Button } from 'soapbox/components/ui'; interface ILoadMore { - onClick: React.MouseEventHandler, - disabled?: boolean, - visible?: Boolean, + onClick: React.MouseEventHandler + disabled?: boolean + visible?: Boolean } const LoadMore: React.FC = ({ onClick, disabled, visible = true }) => { diff --git a/app/soapbox/components/location-search.tsx b/app/soapbox/components/location-search.tsx index fc108e0e8..df0622f2f 100644 --- a/app/soapbox/components/location-search.tsx +++ b/app/soapbox/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/app/soapbox/components/media-gallery.tsx b/app/soapbox/components/media-gallery.tsx index dbf1119cc..001ac0729 100644 --- a/app/soapbox/components/media-gallery.tsx +++ b/app/soapbox/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 = ({ @@ -261,16 +261,16 @@ const Item: React.FC = ({ }; 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, + 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 } const MediaGallery: React.FC = (props) => { diff --git a/app/soapbox/components/modal-root.tsx b/app/soapbox/components/modal-root.tsx index 581c167d8..84c1252c9 100644 --- a/app/soapbox/components/modal-root.tsx +++ b/app/soapbox/components/modal-root.tsx @@ -39,10 +39,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/app/soapbox/components/outline-box.tsx b/app/soapbox/components/outline-box.tsx index 5db74c4ab..6994e6bd1 100644 --- a/app/soapbox/components/outline-box.tsx +++ b/app/soapbox/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/app/soapbox/components/polls/poll-footer.tsx b/app/soapbox/components/polls/poll-footer.tsx index 693b28db1..c62cc9522 100644 --- a/app/soapbox/components/polls/poll-footer.tsx +++ b/app/soapbox/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/app/soapbox/components/polls/poll-option.tsx b/app/soapbox/components/polls/poll-option.tsx index d318b287e..792a3a066 100644 --- a/app/soapbox/components/polls/poll-option.tsx +++ b/app/soapbox/components/polls/poll-option.tsx @@ -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/app/soapbox/components/polls/poll.tsx b/app/soapbox/components/polls/poll.tsx index 2b6f99392..a925e9597 100644 --- a/app/soapbox/components/polls/poll.tsx +++ b/app/soapbox/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/app/soapbox/components/profile-hover-card.tsx b/app/soapbox/components/profile-hover-card.tsx index e832db513..211776836 100644 --- a/app/soapbox/components/profile-hover-card.tsx +++ b/app/soapbox/components/profile-hover-card.tsx @@ -54,7 +54,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/app/soapbox/components/progress-circle.tsx b/app/soapbox/components/progress-circle.tsx index fa85f9a63..af5bf396c 100644 --- a/app/soapbox/components/progress-circle.tsx +++ b/app/soapbox/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/app/soapbox/components/pull-to-refresh.tsx b/app/soapbox/components/pull-to-refresh.tsx index 829441b37..bf033eaa4 100644 --- a/app/soapbox/components/pull-to-refresh.tsx +++ b/app/soapbox/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/app/soapbox/components/pullable.tsx b/app/soapbox/components/pullable.tsx index 88394b828..a8fe6afea 100644 --- a/app/soapbox/components/pullable.tsx +++ b/app/soapbox/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/app/soapbox/components/quoted-status.tsx b/app/soapbox/components/quoted-status.tsx index 8122480fe..065d41216 100644 --- a/app/soapbox/components/quoted-status.tsx +++ b/app/soapbox/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/app/soapbox/components/radio.tsx b/app/soapbox/components/radio.tsx index ef204b06f..f81412bb7 100644 --- a/app/soapbox/components/radio.tsx +++ b/app/soapbox/components/radio.tsx @@ -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/app/soapbox/components/relative-timestamp.tsx b/app/soapbox/components/relative-timestamp.tsx index 6af0883c6..69cec7374 100644 --- a/app/soapbox/components/relative-timestamp.tsx +++ b/app/soapbox/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/app/soapbox/components/safe-embed.tsx b/app/soapbox/components/safe-embed.tsx index b794bbed2..d77d0b3fa 100644 --- a/app/soapbox/components/safe-embed.tsx +++ b/app/soapbox/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/app/soapbox/components/scroll-top-button.tsx b/app/soapbox/components/scroll-top-button.tsx index 21c368b34..2a1ddd812 100644 --- a/app/soapbox/components/scroll-top-button.tsx +++ b/app/soapbox/components/scroll-top-button.tsx @@ -9,15 +9,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/app/soapbox/components/scrollable-list.tsx b/app/soapbox/components/scrollable-list.tsx index fae4b0f40..a56c294b3 100644 --- a/app/soapbox/components/scrollable-list.tsx +++ b/app/soapbox/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,44 +37,44 @@ 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 /** 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 } diff --git a/app/soapbox/components/sidebar-menu.tsx b/app/soapbox/components/sidebar-menu.tsx index e87cb16df..ffe3a0e98 100644 --- a/app/soapbox/components/sidebar-menu.tsx +++ b/app/soapbox/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/app/soapbox/components/sidebar-navigation-link.tsx b/app/soapbox/components/sidebar-navigation-link.tsx index 3103972db..108d4376c 100644 --- a/app/soapbox/components/sidebar-navigation-link.tsx +++ b/app/soapbox/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 /** 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/app/soapbox/components/site-logo.tsx b/app/soapbox/components/site-logo.tsx index 771c19a57..eb7f414b0 100644 --- a/app/soapbox/components/site-logo.tsx +++ b/app/soapbox/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/app/soapbox/components/status-action-bar.tsx b/app/soapbox/components/status-action-bar.tsx index 813ed0aae..8e8d9c202 100644 --- a/app/soapbox/components/status-action-bar.tsx +++ b/app/soapbox/components/status-action-bar.tsx @@ -97,10 +97,10 @@ const messages = defineMessages({ }); interface IStatusActionBar { - status: Status, - withLabels?: boolean, - expandable?: boolean, - space?: 'expand' | 'compact', + status: Status + withLabels?: boolean + expandable?: boolean + space?: 'expand' | 'compact' } const StatusActionBar: React.FC = ({ diff --git a/app/soapbox/components/status-action-button.tsx b/app/soapbox/components/status-action-button.tsx index 7cdb36a4e..6fe7130f6 100644 --- a/app/soapbox/components/status-action-button.tsx +++ b/app/soapbox/components/status-action-button.tsx @@ -12,7 +12,7 @@ const COLORS = { type Color = keyof typeof COLORS; interface IStatusActionCounter { - count: number, + count: number } /** Action button numerical counter, eg "5" likes. */ @@ -25,14 +25,14 @@ 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?: string, - text?: React.ReactNode, + iconClassName?: string + icon: string + count?: number + active?: boolean + color?: Color + filled?: boolean + emoji?: string + text?: React.ReactNode } const StatusActionButton = React.forwardRef((props, ref): JSX.Element => { diff --git a/app/soapbox/components/status-content.tsx b/app/soapbox/components/status-content.tsx index 672e8866f..2dcf673d6 100644 --- a/app/soapbox/components/status-content.tsx +++ b/app/soapbox/components/status-content.tsx @@ -20,7 +20,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) */ @@ -32,11 +32,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/app/soapbox/components/status-hover-card.tsx b/app/soapbox/components/status-hover-card.tsx index bd1a92787..4f91bff4e 100644 --- a/app/soapbox/components/status-hover-card.tsx +++ b/app/soapbox/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/app/soapbox/components/status-list.tsx b/app/soapbox/components/status-list.tsx index f7da49f2a..937dac8de 100644 --- a/app/soapbox/components/status-list.tsx +++ b/app/soapbox/components/status-list.tsx @@ -23,31 +23,31 @@ import type { Ad as AdEntity } from 'soapbox/types/soapbox'; 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/app/soapbox/components/status-media.tsx b/app/soapbox/components/status-media.tsx index d1ca296e9..0867e6ca2 100644 --- a/app/soapbox/components/status-media.tsx +++ b/app/soapbox/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/app/soapbox/components/status-reaction-wrapper.tsx b/app/soapbox/components/status-reaction-wrapper.tsx index 47677e157..224da7cda 100644 --- a/app/soapbox/components/status-reaction-wrapper.tsx +++ b/app/soapbox/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/app/soapbox/components/status-reply-mentions.tsx b/app/soapbox/components/status-reply-mentions.tsx index 335fd38f3..7bd44495c 100644 --- a/app/soapbox/components/status-reply-mentions.tsx +++ b/app/soapbox/components/status-reply-mentions.tsx @@ -10,8 +10,8 @@ import { useAppDispatch } from 'soapbox/hooks'; 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/app/soapbox/components/status.tsx b/app/soapbox/components/status.tsx index 3996777fb..16358f9dd 100644 --- a/app/soapbox/components/status.tsx +++ b/app/soapbox/components/status.tsx @@ -38,22 +38,22 @@ const messages = defineMessages({ }); 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', - 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' + showGroup?: boolean + accountAction?: React.ReactElement } const Status: React.FC = (props) => { diff --git a/app/soapbox/components/still-image.tsx b/app/soapbox/components/still-image.tsx index e3844cda4..098da0579 100644 --- a/app/soapbox/components/still-image.tsx +++ b/app/soapbox/components/still-image.tsx @@ -5,17 +5,17 @@ import { useSettings } from 'soapbox/hooks'; 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 } /** Renders images on a canvas, only playing GIFs if autoPlayGif is enabled. */ @@ -80,7 +80,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/app/soapbox/components/thumb-navigation-link.tsx b/app/soapbox/components/thumb-navigation-link.tsx index fab88b810..46c3ae4a7 100644 --- a/app/soapbox/components/thumb-navigation-link.tsx +++ b/app/soapbox/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/app/soapbox/components/tombstone.tsx b/app/soapbox/components/tombstone.tsx index 0507d90dd..6c6a2a6f9 100644 --- a/app/soapbox/components/tombstone.tsx +++ b/app/soapbox/components/tombstone.tsx @@ -5,9 +5,9 @@ import { FormattedMessage } from 'react-intl'; import { Text } from 'soapbox/components/ui'; 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/app/soapbox/components/translate-button.tsx b/app/soapbox/components/translate-button.tsx index bd6df6d9d..68358ff60 100644 --- a/app/soapbox/components/translate-button.tsx +++ b/app/soapbox/components/translate-button.tsx @@ -11,7 +11,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/app/soapbox/components/ui/accordion/accordion.tsx b/app/soapbox/components/ui/accordion/accordion.tsx index e9df06014..f83a011be 100644 --- a/app/soapbox/components/ui/accordion/accordion.tsx +++ b/app/soapbox/components/ui/accordion/accordion.tsx @@ -16,11 +16,11 @@ const messages = defineMessages({ }); interface IAccordion { - headline: React.ReactNode, - children?: React.ReactNode, - menu?: Menu, - expanded?: boolean, - onToggle?: (value: boolean) => void, + headline: React.ReactNode + children?: React.ReactNode + menu?: Menu + expanded?: boolean + onToggle?: (value: boolean) => void } /** diff --git a/app/soapbox/components/ui/avatar/avatar.tsx b/app/soapbox/components/ui/avatar/avatar.tsx index 89ea8ff36..aef3c7147 100644 --- a/app/soapbox/components/ui/avatar/avatar.tsx +++ b/app/soapbox/components/ui/avatar/avatar.tsx @@ -7,11 +7,11 @@ const AVATAR_SIZE = 42; interface IAvatar { /** URL to the avatar image. */ - src: string, + src: string /** Width and height of the avatar in pixels. */ - size?: number, + size?: number /** Extra class names for the div surrounding the avatar image. */ - className?: string, + className?: string } /** Round profile avatar for accounts. */ diff --git a/app/soapbox/components/ui/banner/banner.tsx b/app/soapbox/components/ui/banner/banner.tsx index 3acba0a31..da6f7ed03 100644 --- a/app/soapbox/components/ui/banner/banner.tsx +++ b/app/soapbox/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/app/soapbox/components/ui/button/button.tsx b/app/soapbox/components/ui/button/button.tsx index c256b706b..e06ffa7d1 100644 --- a/app/soapbox/components/ui/button/button.tsx +++ b/app/soapbox/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