diff --git a/.eslintrc.json b/.eslintrc.json index 54e72c64f..f48320d4d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -317,7 +317,7 @@ "formatjs/enforce-default-message": "error", "formatjs/enforce-id": "error", - "formatjs/no-literal-string-in-jsx": "warn" + "formatjs/no-literal-string-in-jsx": "error" }, "overrides": [ { diff --git a/src/components/account.tsx b/src/components/account.tsx index f61029250..a9eb9a546 100644 --- a/src/components/account.tsx +++ b/src/components/account.tsx @@ -239,7 +239,7 @@ const Account = ({ - @{acct ?? username} + @{acct ?? username} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {account.pleroma?.favicon && ( @@ -247,7 +247,7 @@ const Account = ({ {(timestamp) ? ( <> - · + · {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {timestampUrl ? ( event.stopPropagation()}> @@ -261,7 +261,7 @@ const Account = ({ {approvalStatus && ['pending', 'rejected'].includes(approvalStatus) && ( <> - · + · {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {approvalStatus === 'pending' @@ -273,7 +273,7 @@ const Account = ({ {showEdit ? ( <> - · + · {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} @@ -281,7 +281,7 @@ const Account = ({ {actionType === 'muting' && account.mute_expires_at ? ( <> - · + · {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} diff --git a/src/components/announcements/announcement.tsx b/src/components/announcements/announcement.tsx index 3b07e8ece..0bacdd60c 100644 --- a/src/components/announcements/announcement.tsx +++ b/src/components/announcements/announcement.tsx @@ -41,9 +41,11 @@ const Announcement: React.FC = ({ announcement, emojiMap }) => { hour={skipTime ? undefined : 'numeric'} minute={skipTime ? undefined : '2-digit'} /> + {/* eslint-disable formatjs/no-literal-string-in-jsx */} {' '} - {' '} + {/* eslint-enable formatjs/no-literal-string-in-jsx */} = ({ announcementId, reaction, emojiMap, sty onClick={handleClick} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave} - title={`:${shortCode}:`} + title={`:${shortCode}:`} // eslint-disable-line formatjs/no-literal-string-in-jsx style={style} > diff --git a/src/components/display-name-inline.tsx b/src/components/display-name-inline.tsx index f130e20ee..0f754fe07 100644 --- a/src/components/display-name-inline.tsx +++ b/src/components/display-name-inline.tsx @@ -31,12 +31,13 @@ const DisplayNameInline: React.FC = ({ account, withSuffix = true ); + // eslint-disable-next-line formatjs/no-literal-string-in-jsx const suffix = (@{getAcct(account, displayFqn)}); return (
{displayName} - - + - {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {withSuffix && suffix}
); diff --git a/src/components/display-name.tsx b/src/components/display-name.tsx index bb6c8816b..130e1f0df 100644 --- a/src/components/display-name.tsx +++ b/src/components/display-name.tsx @@ -33,7 +33,7 @@ const DisplayName: React.FC = ({ account, children, withSuffix = t ); - const suffix = (@{getAcct(account, displayFqn)}); + const suffix = (@{getAcct(account, displayFqn)}); // eslint-disable-line formatjs/no-literal-string-in-jsx return ( diff --git a/src/components/hashtag.tsx b/src/components/hashtag.tsx index 1963c4f04..690661515 100644 --- a/src/components/hashtag.tsx +++ b/src/components/hashtag.tsx @@ -20,7 +20,7 @@ const Hashtag: React.FC = ({ hashtag }) => { - #{hashtag.name} + #{hashtag.name} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {Boolean(count) && ( diff --git a/src/components/media-gallery.tsx b/src/components/media-gallery.tsx index a4ee9dd1b..aae7d3ca3 100644 --- a/src/components/media-gallery.tsx +++ b/src/components/media-gallery.tsx @@ -228,7 +228,7 @@ const Item: React.FC = ({ {...conditionalAttributes} /> - GIF + GIF {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} ); } else if (attachment.type === 'audio') { @@ -276,7 +276,7 @@ const Item: React.FC = ({ style={{ position, float, left, top, right, bottom, height, width: `${width}%` }} > {last && total > ATTACHMENT_LIMIT && ( -
+
{/* eslint-disable-line formatjs/no-literal-string-in-jsx */} +{total - ATTACHMENT_LIMIT + 1}
)} diff --git a/src/components/polls/poll-footer.tsx b/src/components/polls/poll-footer.tsx index 9fc40b073..09798f828 100644 --- a/src/components/polls/poll-footer.tsx +++ b/src/components/polls/poll-footer.tsx @@ -63,7 +63,7 @@ const PollFooter: React.FC = ({ poll, showResults, selected }): JSX - · + · {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} )} @@ -75,7 +75,7 @@ const PollFooter: React.FC = ({ poll, showResults, selected }): JSX - · + · {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} )} @@ -85,7 +85,7 @@ const PollFooter: React.FC = ({ poll, showResults, selected }): JSX {poll.expires_at !== null && ( <> - · + · {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {timeRemaining} )} diff --git a/src/components/polls/poll-option.tsx b/src/components/polls/poll-option.tsx index 020ede4b0..1c0760188 100644 --- a/src/components/polls/poll-option.tsx +++ b/src/components/polls/poll-option.tsx @@ -152,7 +152,7 @@ const PollOption: React.FC = (props): JSX.Element | null => { )}
- {Math.round(percent)}% + {Math.round(percent)}% {/* eslint-disable-line formatjs/no-literal-string-in-jsx */}
diff --git a/src/components/site-error-boundary.tsx b/src/components/site-error-boundary.tsx index 513906b2e..3e4712a4c 100644 --- a/src/components/site-error-boundary.tsx +++ b/src/components/site-error-boundary.tsx @@ -105,16 +105,20 @@ const SiteErrorBoundary: React.FC = ({ children }) => {

+ {/* eslint-disable formatjs/no-literal-string-in-jsx */} {sourceCode.displayName}: {' '}{sourceCode.version} + {/* eslint-enable formatjs/no-literal-string-in-jsx */}
diff --git a/src/components/status-action-bar.tsx b/src/components/status-action-bar.tsx index 5223214f7..93b03cd15 100644 --- a/src/components/status-action-bar.tsx +++ b/src/components/status-action-bar.tsx @@ -321,7 +321,7 @@ const StatusActionBar: React.FC = ({ dispatch(openModal('CONFIRM', { icon: require('@tabler/icons/outline/ban.svg'), heading: , - message: @{account.acct} }} />, + message: @{account.acct} }} />, // eslint-disable-line formatjs/no-literal-string-in-jsx confirm: intl.formatMessage(messages.blockConfirm), onConfirm: () => dispatch(blockAccount(account.id)), secondary: intl.formatMessage(messages.blockAndReport), diff --git a/src/components/status-reply-mentions.tsx b/src/components/status-reply-mentions.tsx index 995cb6904..75eb8eab4 100644 --- a/src/components/status-reply-mentions.tsx +++ b/src/components/status-reply-mentions.tsx @@ -56,7 +56,7 @@ const StatusReplyMentions: React.FC = ({ status, hoverable to={`/@${account.acct}`} className='reply-mentions__account max-w-[200px] truncate align-bottom' onClick={(e) => e.stopPropagation()} - > + > {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} @{shortenNostr(account.username)} ); diff --git a/src/components/status.tsx b/src/components/status.tsx index 3d9349fd2..022eab385 100644 --- a/src/components/status.tsx +++ b/src/components/status.tsx @@ -334,6 +334,7 @@ const Status: React.FC = (props) => { return (
+ {/* eslint-disable formatjs/no-literal-string-in-jsx */} : {status.filtered.join(', ')}. {' '} @@ -341,6 +342,7 @@ const Status: React.FC = (props) => { + {/* eslint-enable formatjs/no-literal-string-in-jsx */}
); diff --git a/src/components/statuses/sensitive-content-overlay.tsx b/src/components/statuses/sensitive-content-overlay.tsx index 6812b9531..cb50c722b 100644 --- a/src/components/statuses/sensitive-content-overlay.tsx +++ b/src/components/statuses/sensitive-content-overlay.tsx @@ -118,9 +118,11 @@ const SensitiveContentOverlay = React.forwardRef + {/* eslint-disable formatjs/no-literal-string-in-jsx */} + {/* eslint-enable formatjs/no-literal-string-in-jsx */} )} diff --git a/src/components/ui/button/button.test.tsx b/src/components/ui/button/button.test.tsx index 5554caf0e..4124958d7 100644 --- a/src/components/ui/button/button.test.tsx +++ b/src/components/ui/button/button.test.tsx @@ -13,14 +13,14 @@ describe('); + render(); // eslint-disable-line formatjs/no-literal-string-in-jsx expect(screen.getByRole('button')).toHaveTextContent('children'); }); it('renders the props.text instead of children', () => { const text = 'foo'; - const children =

children

; + const children =

children

; // eslint-disable-line formatjs/no-literal-string-in-jsx render(); expect(screen.getByRole('button')).toHaveTextContent('foo'); @@ -63,13 +63,13 @@ describe('); + render(); // eslint-disable-line formatjs/no-literal-string-in-jsx expect(screen.getByRole('link')).toBeInTheDocument(); }); it('does not render a link', () => { - render(); + render(); //eslint-disable-line formatjs/no-literal-string-in-jsx expect(screen.queryAllByRole('link')).toHaveLength(0); }); @@ -77,13 +77,13 @@ describe('); + render(); // eslint-disable-line formatjs/no-literal-string-in-jsx expect(screen.getByTestId('icon')).toBeInTheDocument(); }); it('does not render an icon', () => { - render(); + render(); // eslint-disable-line formatjs/no-literal-string-in-jsx expect(screen.queryAllByTestId('icon')).toHaveLength(0); }); diff --git a/src/components/ui/card/card.test.tsx b/src/components/ui/card/card.test.tsx index aa540f6da..1971441ae 100644 --- a/src/components/ui/card/card.test.tsx +++ b/src/components/ui/card/card.test.tsx @@ -12,7 +12,7 @@ describe('', () => { - + {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} Card Body , diff --git a/src/components/ui/form-actions/form-actions.test.tsx b/src/components/ui/form-actions/form-actions.test.tsx index 53738853d..32ff56638 100644 --- a/src/components/ui/form-actions/form-actions.test.tsx +++ b/src/components/ui/form-actions/form-actions.test.tsx @@ -6,7 +6,7 @@ import FormActions from './form-actions'; describe('', () => { it('renders successfully', () => { - render(
child
); + render(
child
); {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} expect(screen.getByTestId('child')).toBeInTheDocument(); }); diff --git a/src/components/ui/form/form.test.tsx b/src/components/ui/form/form.test.tsx index 35fdddcf8..c25d590ed 100644 --- a/src/components/ui/form/form.test.tsx +++ b/src/components/ui/form/form.test.tsx @@ -8,7 +8,7 @@ describe('
', () => { it('renders children', () => { const onSubmitMock = vi.fn(); render( - children
, +
children
, // eslint-disable-line formatjs/no-literal-string-in-jsx ); expect(screen.getByTestId('form')).toHaveTextContent('children'); @@ -17,7 +17,7 @@ describe('
', () => { it('handles onSubmit prop', () => { const onSubmitMock = vi.fn(); render( - children
, +
children
, // eslint-disable-line formatjs/no-literal-string-in-jsx ); fireEvent.submit( diff --git a/src/features/about/index.tsx b/src/features/about/index.tsx index 56da0776e..04bfb7176 100644 --- a/src/features/about/index.tsx +++ b/src/features/about/index.tsx @@ -39,7 +39,7 @@ const AboutPage: React.FC = () => { const alsoAvailable = (defaultLocale) && ( ); } else if (attachment.type === 'audio') { diff --git a/src/features/account/components/header.tsx b/src/features/account/components/header.tsx index c5949a470..a9bd79b1a 100644 --- a/src/features/account/components/header.tsx +++ b/src/features/account/components/header.tsx @@ -137,7 +137,7 @@ const Header: React.FC = ({ account }) => { dispatch(openModal('CONFIRM', { icon: require('@tabler/icons/outline/ban.svg'), heading: , - message: @{account.acct} }} />, + message: @{account.acct} }} />, // eslint-disable-line formatjs/no-literal-string-in-jsx confirm: intl.formatMessage(messages.blockConfirm), onConfirm: () => dispatch(blockAccount(account.id)), secondary: intl.formatMessage(messages.blockAndReport), @@ -222,7 +222,7 @@ const Header: React.FC = ({ account }) => { const unfollowModal = getSettings(getState()).get('unfollowModal'); if (unfollowModal) { dispatch(openModal('CONFIRM', { - message: @{account.acct} }} />, + message: @{account.acct} }} />, // eslint-disable-line formatjs/no-literal-string-in-jsx confirm: intl.formatMessage(messages.removeFromFollowersConfirm), onConfirm: () => dispatch(removeFromFollowers(account.id)), })); diff --git a/src/features/admin/announcements.tsx b/src/features/admin/announcements.tsx index 7af9d28c6..fd22856f7 100644 --- a/src/features/admin/announcements.tsx +++ b/src/features/admin/announcements.tsx @@ -52,7 +52,7 @@ const Announcement: React.FC = ({ announcement }) => { - {' '} + {' '} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} )} @@ -61,7 +61,7 @@ const Announcement: React.FC = ({ announcement }) => { - {' '} + {' '} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} )} diff --git a/src/features/admin/components/report.tsx b/src/features/admin/components/report.tsx index 495ba3596..3f451dcb6 100644 --- a/src/features/admin/components/report.tsx +++ b/src/features/admin/components/report.tsx @@ -96,7 +96,7 @@ const Report: React.FC = ({ id }) => { defaultMessage='Report on {acct}' values={{ acct: ( - @{acct} + @{acct} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} ) }} /> @@ -129,14 +129,14 @@ const Report: React.FC = ({ id }) => { )} - + {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} + > {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} @{reporterAcct} diff --git a/src/features/admin/domains.tsx b/src/features/admin/domains.tsx index 60a89d43f..7ae4b19f3 100644 --- a/src/features/admin/domains.tsx +++ b/src/features/admin/domains.tsx @@ -71,7 +71,7 @@ const Domain: React.FC = ({ domain }) => { - {' '} + {' '} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {domain.domain} diff --git a/src/features/admin/relays.tsx b/src/features/admin/relays.tsx index e3d06a9ba..1f028c4ea 100644 --- a/src/features/admin/relays.tsx +++ b/src/features/admin/relays.tsx @@ -40,7 +40,7 @@ const Relay: React.FC = ({ relay }) => { - {' '} + {' '} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {relay.actor} {relay.followed_back && ( diff --git a/src/features/admin/rules.tsx b/src/features/admin/rules.tsx index e4b9754e5..10a840f58 100644 --- a/src/features/admin/rules.tsx +++ b/src/features/admin/rules.tsx @@ -51,7 +51,7 @@ const Rule: React.FC = ({ rule }) => { - {' '} + {' '} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {rule.priority} )} diff --git a/src/features/admin/tabs/dashboard.tsx b/src/features/admin/tabs/dashboard.tsx index 0184990cc..d1c215403 100644 --- a/src/features/admin/tabs/dashboard.tsx +++ b/src/features/admin/tabs/dashboard.tsx @@ -159,7 +159,7 @@ const Dashboard: React.FC = () => { }> - {v.software + (v.build ? `+${v.build}` : '')} {v.version} + {v.software + (v.build ? `+${v.build}` : '')} {v.version} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} diff --git a/src/features/aliases/index.tsx b/src/features/aliases/index.tsx index 1b6caab8b..36a3327de 100644 --- a/src/features/aliases/index.tsx +++ b/src/features/aliases/index.tsx @@ -75,7 +75,7 @@ const Aliases = () => {
- {' '} + {' '} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {alias}
diff --git a/src/features/audio/index.tsx b/src/features/audio/index.tsx index 62903f125..366a6a076 100644 --- a/src/features/audio/index.tsx +++ b/src/features/audio/index.tsx @@ -554,7 +554,7 @@ const Audio: React.FC = (props) => { {formatTime(Math.floor(currentTime))} {getDuration() && (<> - / + / {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {formatTime(Math.floor(getDuration()))} )} diff --git a/src/features/auth-login/components/password-reset-confirm.test.tsx b/src/features/auth-login/components/password-reset-confirm.test.tsx index ab2372d08..d4c8d1196 100644 --- a/src/features/auth-login/components/password-reset-confirm.test.tsx +++ b/src/features/auth-login/components/password-reset-confirm.test.tsx @@ -9,7 +9,7 @@ import PasswordResetConfirm from './password-reset-confirm'; const TestableComponent = () => ( - Homepage + Homepage {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} ); diff --git a/src/features/chats/components/chat-list-item.tsx b/src/features/chats/components/chat-list-item.tsx index 3cdd41c0b..124ecb036 100644 --- a/src/features/chats/components/chat-list-item.tsx +++ b/src/features/chats/components/chat-list-item.tsx @@ -84,7 +84,7 @@ const ChatListItem: React.FC = ({ chat, onClick }) => {
- {chat.account?.display_name || `@${chat.account.username}`} + {chat.account?.display_name || `@${chat.account.username}`} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {chat.account?.verified && }
diff --git a/src/features/chats/components/chat-message-list-intro.tsx b/src/features/chats/components/chat-message-list-intro.tsx index f5af0113b..dcb0439fb 100644 --- a/src/features/chats/components/chat-message-list-intro.tsx +++ b/src/features/chats/components/chat-message-list-intro.tsx @@ -74,13 +74,13 @@ const ChatMessageListIntro = () => { {needsAcceptance ? ( <> - @{chat.account.acct} + @{chat.account.acct} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {' '} {intl.formatMessage(messages.intro)} ) : ( - @{chat.account.acct} + @{chat.account.acct} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} )} diff --git a/src/features/chats/components/chat-message-list.tsx b/src/features/chats/components/chat-message-list.tsx index cce1feff4..8d4e02f1d 100644 --- a/src/features/chats/components/chat-message-list.tsx +++ b/src/features/chats/components/chat-message-list.tsx @@ -195,7 +195,7 @@ const ChatMessageList: React.FC = ({ chat }) => { <> {intl.formatMessage(messages.blockedBy)} {' '} - @{chat.account.acct} + @{chat.account.acct} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */}
diff --git a/src/features/chats/components/chat-page/components/chat-page-main.tsx b/src/features/chats/components/chat-page/components/chat-page-main.tsx index 578d2261c..71934fa9b 100644 --- a/src/features/chats/components/chat-page/components/chat-page-main.tsx +++ b/src/features/chats/components/chat-page/components/chat-page-main.tsx @@ -134,7 +134,7 @@ const ChatPageMain = () => {
- {chat.account.display_name || `@${chat.account.username}`} + {chat.account.display_name || `@${chat.account.username}`} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {chat.account.verified && } @@ -173,7 +173,7 @@ const ChatPageMain = () => { {chat.account.display_name} - @{chat.account.acct} + @{chat.account.acct} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} diff --git a/src/features/chats/components/chat-pane-header.test.tsx b/src/features/chats/components/chat-pane-header.test.tsx index 6faac3fa8..a518c183a 100644 --- a/src/features/chats/components/chat-pane-header.test.tsx +++ b/src/features/chats/components/chat-pane-header.test.tsx @@ -27,7 +27,7 @@ describe('', () => { describe('when it is a node', () => { it('renders the title', () => { const title = ( -

hello world

+

hello world

// eslint-disable-line formatjs/no-literal-string-in-jsx ); render(); diff --git a/src/features/chats/components/chat-search/chat-search.test.tsx b/src/features/chats/components/chat-search/chat-search.test.tsx index c2f1c8534..3555a66ae 100644 --- a/src/features/chats/components/chat-search/chat-search.test.tsx +++ b/src/features/chats/components/chat-search/chat-search.test.tsx @@ -12,7 +12,7 @@ const renderComponent = () => render( - , + , {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} , ); diff --git a/src/features/chats/components/chat-search/results.tsx b/src/features/chats/components/chat-search/results.tsx index 1edec0dde..91a6fdb95 100644 --- a/src/features/chats/components/chat-search/results.tsx +++ b/src/features/chats/components/chat-search/results.tsx @@ -41,7 +41,7 @@ const Results = ({ accountSearchResult, onSelect }: IResults) => { {account.display_name} {account.verified && }
- @{account.acct} + @{account.acct} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} diff --git a/src/features/chats/components/chat-widget.test.tsx b/src/features/chats/components/chat-widget.test.tsx index 933a2a570..55d2af647 100644 --- a/src/features/chats/components/chat-widget.test.tsx +++ b/src/features/chats/components/chat-widget.test.tsx @@ -35,8 +35,10 @@ describe('', () => { it('hides the widget', async () => { const App = () => ( + {/* eslint-disable formatjs/no-literal-string-in-jsx */} Chats page Homepage + {/* eslint-enable formatjs/no-literal-string-in-jsx */} ); @@ -85,8 +87,10 @@ describe('', () => { it('shows the widget', async () => { const App = () => ( + {/* eslint-disable formatjs/no-literal-string-in-jsx */} Chats page Homepage + {/* eslint-enable formatjs/no-literal-string-in-jsx */} ); diff --git a/src/features/chats/components/chat-widget/chat-pane-header.tsx b/src/features/chats/components/chat-widget/chat-pane-header.tsx index 1fad1602c..5cff70014 100644 --- a/src/features/chats/components/chat-widget/chat-pane-header.tsx +++ b/src/features/chats/components/chat-widget/chat-pane-header.tsx @@ -43,9 +43,11 @@ const ChatPaneHeader = (props: IChatPaneHeader) => { {(typeof unreadCount !== 'undefined' && unreadCount > 0) && ( + {/* eslint-disable formatjs/no-literal-string-in-jsx */} ({unreadCount}) + {/* eslint-enable formatjs/no-literal-string-in-jsx */}
diff --git a/src/features/chats/components/chat-widget/chat-settings.tsx b/src/features/chats/components/chat-widget/chat-settings.tsx index 30b3d88f4..6c337f60c 100644 --- a/src/features/chats/components/chat-widget/chat-settings.tsx +++ b/src/features/chats/components/chat-widget/chat-settings.tsx @@ -112,7 +112,7 @@ const ChatSettings = () => { {chat.account.display_name} - @{chat.account.acct} + @{chat.account.acct} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} diff --git a/src/features/chats/components/chat-widget/chat-window.tsx b/src/features/chats/components/chat-widget/chat-window.tsx index 4f183623a..1e9ca007f 100644 --- a/src/features/chats/components/chat-widget/chat-window.tsx +++ b/src/features/chats/components/chat-widget/chat-window.tsx @@ -88,7 +88,7 @@ const ChatWindow = () => {
- {chat.account.display_name || `@${chat.account.acct}`} + {chat.account.display_name || `@${chat.account.acct}`} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {chat.account.verified && }
diff --git a/src/features/compose/components/polls/poll-form.tsx b/src/features/compose/components/polls/poll-form.tsx index fce9cae8f..e28fac52f 100644 --- a/src/features/compose/components/polls/poll-form.tsx +++ b/src/features/compose/components/polls/poll-form.tsx @@ -74,7 +74,7 @@ const Option: React.FC = ({
- {index + 1}. + {index + 1}. {/* eslint-disable-line formatjs/no-literal-string-in-jsx */}
= ({ composeId }) => { const accounts = to.slice(0, 2).map((acct: string) => { const username = acct.split('@')[0]; return ( - + {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} @{shortenNostr(username)} ); diff --git a/src/features/developers/developers-challenge.tsx b/src/features/developers/developers-challenge.tsx index ee83ba809..cc379975e 100644 --- a/src/features/developers/developers-challenge.tsx +++ b/src/features/developers/developers-challenge.tsx @@ -41,11 +41,13 @@ const DevelopersChallenge = () => {
+ {/* eslint-disable formatjs/no-literal-string-in-jsx */} soapbox() }} /> + {/* eslint-enable formatjs/no-literal-string-in-jsx */} diff --git a/src/features/event/components/event-header.tsx b/src/features/event/components/event-header.tsx index 01e567812..cd21a2565 100644 --- a/src/features/event/components/event-header.tsx +++ b/src/features/event/components/event-header.tsx @@ -164,7 +164,7 @@ const EventHeader: React.FC = ({ status }) => { dispatch(openModal('CONFIRM', { icon: require('@tabler/icons/outline/ban.svg'), heading: , - message: @{account.acct} }} />, + message: {/* eslint-disable-line formatjs/no-literal-string-in-jsx */}@{account.acct} }} />, confirm: intl.formatMessage(messages.blockConfirm), onConfirm: () => dispatch(blockAccount(account.id)), secondary: intl.formatMessage(messages.blockAndReport), diff --git a/src/features/feed-suggestions/feed-suggestions.tsx b/src/features/feed-suggestions/feed-suggestions.tsx index 80ed07122..44179f338 100644 --- a/src/features/feed-suggestions/feed-suggestions.tsx +++ b/src/features/feed-suggestions/feed-suggestions.tsx @@ -50,7 +50,7 @@ const SuggestionItem: React.FC = ({ accountId }) => { {account.verified && } - @{account.acct} + @{account.acct} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} diff --git a/src/features/filters/index.tsx b/src/features/filters/index.tsx index 99e46039b..52e647cef 100644 --- a/src/features/filters/index.tsx +++ b/src/features/filters/index.tsx @@ -86,12 +86,12 @@ const Filters = () => { - {' '} + {' '} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {filter.keywords.map(keyword => keyword.keyword).join(', ')} - {' '} + {' '} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {filter.context.map(context => contexts[context] ? intl.formatMessage(contexts[context]) : context).join(', ')} diff --git a/src/features/group/components/group-member-count.tsx b/src/features/group/components/group-member-count.tsx index 797d618b2..134210f9f 100644 --- a/src/features/group/components/group-member-count.tsx +++ b/src/features/group/components/group-member-count.tsx @@ -15,7 +15,7 @@ const GroupMemberCount = ({ group }: IGroupMemberCount) => { {shortNumberFormat(group.members_count)} - {' '} + {' '} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} { > + {/* eslint-disable formatjs/no-literal-string-in-jsx */} { > #{tag.name} + {/* eslint-enable formatjs/no-literal-string-in-jsx */} + {/* eslint-disable formatjs/no-literal-string-in-jsx */} {intl.formatMessage(messages.total)}: {' '} + {/* eslint-enable formatjs/no-literal-string-in-jsx */} {shortNumberFormat(tag.uses)} diff --git a/src/features/groups/components/discover/group-grid-item.tsx b/src/features/groups/components/discover/group-grid-item.tsx index 889a815ad..1d0250ebb 100644 --- a/src/features/groups/components/discover/group-grid-item.tsx +++ b/src/features/groups/components/discover/group-grid-item.tsx @@ -58,7 +58,7 @@ const GroupGridItem = forwardRef((props: IGroup, ref: React.ForwardedRef - + {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} diff --git a/src/features/groups/components/discover/group-list-item.tsx b/src/features/groups/components/discover/group-list-item.tsx index 8778fbc25..3294e6312 100644 --- a/src/features/groups/components/discover/group-list-item.tsx +++ b/src/features/groups/components/discover/group-list-item.tsx @@ -52,10 +52,10 @@ const GroupListItem = (props: IGroupListItem) => { {typeof group.members_count !== 'undefined' && ( <> - + {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} {shortNumberFormat(group.members_count)} - {' '} + {' '} {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} ', () => { it('should render correctly', () => { render( Title} - subtitle={Subtitle} + title={Title} /* eslint-disable-line formatjs/no-literal-string-in-jsx */ + subtitle={Subtitle} /* eslint-disable-line formatjs/no-literal-string-in-jsx */ />); expect(screen.getByTestId('no-results')).toHaveTextContent('Title'); diff --git a/src/features/groups/components/discover/tag-list-item.tsx b/src/features/groups/components/discover/tag-list-item.tsx index 102614105..f0e472dac 100644 --- a/src/features/groups/components/discover/tag-list-item.tsx +++ b/src/features/groups/components/discover/tag-list-item.tsx @@ -23,17 +23,19 @@ const TagListItem = (props: ITagListItem) => { + > {/* eslint-disable-line formatjs/no-literal-string-in-jsx */} #{tag.name} + {/* eslint-disable formatjs/no-literal-string-in-jsx */} :{' '} {tag.groups} + {/* eslint-enable formatjs/no-literal-string-in-jsx */} diff --git a/src/features/placeholder/components/placeholder-group-search.tsx b/src/features/placeholder/components/placeholder-group-search.tsx index f07f87312..1eb939acc 100644 --- a/src/features/placeholder/components/placeholder-group-search.tsx +++ b/src/features/placeholder/components/placeholder-group-search.tsx @@ -27,6 +27,7 @@ export default ({ withJoinAction = true }: { withJoinAction?: boolean }) => { {generateText(6)} + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} diff --git a/src/features/security/mfa/otp-confirm-form.tsx b/src/features/security/mfa/otp-confirm-form.tsx index c22a8d8df..1f1d670c4 100644 --- a/src/features/security/mfa/otp-confirm-form.tsx +++ b/src/features/security/mfa/otp-confirm-form.tsx @@ -66,6 +66,7 @@ const OtpConfirmForm: React.FC = () => { + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} 1. @@ -78,6 +79,7 @@ const OtpConfirmForm: React.FC = () => { {state.confirmKey} + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} 2. diff --git a/src/features/soapbox-config/components/site-preview.tsx b/src/features/soapbox-config/components/site-preview.tsx index 82e201e4f..4d1944cda 100644 --- a/src/features/soapbox-config/components/site-preview.tsx +++ b/src/features/soapbox-config/components/site-preview.tsx @@ -36,6 +36,7 @@ const SitePreview: React.FC = ({ soapbox }) => { return (
+ {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} diff --git a/src/features/ui/components/funding-panel.tsx b/src/features/ui/components/funding-panel.tsx index 3d3441383..8cfd0f961 100644 --- a/src/features/ui/components/funding-panel.tsx +++ b/src/features/ui/components/funding-panel.tsx @@ -42,8 +42,10 @@ const FundingPanel: React.FC = () => { let ratioText; if (goalReached) { + // eslint-disable-next-line formatjs/no-literal-string-in-jsx ratioText = <>{moneyFormat(goal)} per month — reached!; } else { + // eslint-disable-next-line formatjs/no-literal-string-in-jsx ratioText = <>{moneyFormat(amount)} out of {moneyFormat(goal)} per month; } diff --git a/src/features/ui/components/modals/boost-modal.tsx b/src/features/ui/components/modals/boost-modal.tsx index bc4d73177..19acf46fe 100644 --- a/src/features/ui/components/modals/boost-modal.tsx +++ b/src/features/ui/components/modals/boost-modal.tsx @@ -38,6 +38,7 @@ const BoostModal: React.FC = ({ status, onReblog, onClose }) => { + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} Shift + }} /> diff --git a/src/features/ui/components/modals/hotkeys-modal.tsx b/src/features/ui/components/modals/hotkeys-modal.tsx index 770ab84c3..7e5ff858f 100644 --- a/src/features/ui/components/modals/hotkeys-modal.tsx +++ b/src/features/ui/components/modals/hotkeys-modal.tsx @@ -38,36 +38,44 @@ const HotkeysModal: React.FC = ({ onClose }) => { + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} r + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} m + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} p + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} f {features.emojiReacts && ( + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} e )} + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} b + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} enter, o + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} a @@ -82,41 +90,50 @@ const HotkeysModal: React.FC = ({ onClose }) => { {features.spoilers && ( + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} x )} {features.spoilers && ( + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} h )} + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} up, k + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} down, j + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} n + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} alt + n + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} backspace + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} s, / + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} esc @@ -130,40 +147,49 @@ const HotkeysModal: React.FC = ({ onClose }) => { + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} g + h + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} g + n + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} g + f + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} g + p + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} g + u + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} g + b + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} g + m {features.followRequests && ( + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} g + r )} + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} ? diff --git a/src/features/ui/components/modals/mute-modal.tsx b/src/features/ui/components/modals/mute-modal.tsx index aa2209fd0..a27127337 100644 --- a/src/features/ui/components/modals/mute-modal.tsx +++ b/src/features/ui/components/modals/mute-modal.tsx @@ -59,6 +59,7 @@ const MuteModal = () => { @{account.acct} }} /> @@ -93,6 +94,7 @@ const MuteModal = () => { {duration !== 0 && ( + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} : diff --git a/src/features/ui/components/modals/onboarding-flow-modal/steps/cover-photo-selection-step.tsx b/src/features/ui/components/modals/onboarding-flow-modal/steps/cover-photo-selection-step.tsx index bcb144b5b..0dac39e3f 100644 --- a/src/features/ui/components/modals/onboarding-flow-modal/steps/cover-photo-selection-step.tsx +++ b/src/features/ui/components/modals/onboarding-flow-modal/steps/cover-photo-selection-step.tsx @@ -135,6 +135,7 @@ const CoverPhotoSelectionModal: React.FC = ({ onClose )} {account?.display_name} + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} @{account?.username}
diff --git a/src/features/ui/components/modals/report-modal/report-modal.tsx b/src/features/ui/components/modals/report-modal/report-modal.tsx index 33ddc8e39..42727fbe2 100644 --- a/src/features/ui/components/modals/report-modal/report-modal.tsx +++ b/src/features/ui/components/modals/report-modal/report-modal.tsx @@ -266,6 +266,7 @@ const ReportModal = ({ onClose }: IReportModal) => { case ReportableEntities.GROUP: return intl.formatMessage(messages.reportGroup); default: + // eslint-disable-next-line formatjs/no-literal-string-in-jsx return @{account?.acct} }} />; } }; diff --git a/src/features/ui/components/modals/zap-split/display-name-row.tsx b/src/features/ui/components/modals/zap-split/display-name-row.tsx index 15feb7403..b6c54a85c 100644 --- a/src/features/ui/components/modals/zap-split/display-name-row.tsx +++ b/src/features/ui/components/modals/zap-split/display-name-row.tsx @@ -37,11 +37,13 @@ const DisplayNameRow: React.FC = ({ account, withSuffix = true })
); + // eslint-disable-next-line formatjs/no-literal-string-in-jsx const suffix = (@{getAcct(account, displayFqn)}); return (
{displayName} + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} - {withSuffix && suffix}
diff --git a/src/features/ui/components/modals/zap-split/zap-split-modal.tsx b/src/features/ui/components/modals/zap-split/zap-split-modal.tsx index 27a36833a..535196571 100644 --- a/src/features/ui/components/modals/zap-split/zap-split-modal.tsx +++ b/src/features/ui/components/modals/zap-split/zap-split-modal.tsx @@ -98,6 +98,7 @@ const ZapSplitModal: React.FC = ({ zapSplitAccounts, onClose, sp )}

+ {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} {currentStep + 1}/{zapSplitAccounts.length}

diff --git a/src/features/ui/components/modals/zap-split/zap-split.tsx b/src/features/ui/components/modals/zap-split/zap-split.tsx index a80f565e7..38a928faf 100644 --- a/src/features/ui/components/modals/zap-split/zap-split.tsx +++ b/src/features/ui/components/modals/zap-split/zap-split.tsx @@ -48,6 +48,7 @@ const ZapSplit = ({ zapData, zapAmount, invoice, onNext, isLastStep, onFinish }:
+ {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}

Help this community grow!

@@ -65,6 +66,7 @@ const ZapSplit = ({ zapData, zapAmount, invoice, onNext, isLastStep, onFinish }:
+ {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} {zapAmount} sats
diff --git a/src/features/ui/components/new-account-zap-split.tsx b/src/features/ui/components/new-account-zap-split.tsx index 2f3e9f749..a5d9d6a20 100644 --- a/src/features/ui/components/new-account-zap-split.tsx +++ b/src/features/ui/components/new-account-zap-split.tsx @@ -75,6 +75,7 @@ const AddNewAccount: React.FC = ({
+ {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} {formattedWeight(newWeight)}% handleChange(e)} />
diff --git a/src/features/ui/components/profile-info-panel.tsx b/src/features/ui/components/profile-info-panel.tsx index e399817d8..312ecbc45 100644 --- a/src/features/ui/components/profile-info-panel.tsx +++ b/src/features/ui/components/profile-info-panel.tsx @@ -122,6 +122,7 @@ const ProfileInfoPanel: React.FC = ({ account, username }) => + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} @{username} @@ -154,6 +155,7 @@ const ProfileInfoPanel: React.FC = ({ account, username }) => + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} @{displayFqn ? account.fqn : account.acct} diff --git a/src/features/ui/components/user-panel.tsx b/src/features/ui/components/user-panel.tsx index 368887696..c6c2a9d12 100644 --- a/src/features/ui/components/user-panel.tsx +++ b/src/features/ui/components/user-panel.tsx @@ -70,6 +70,7 @@ const UserPanel: React.FC = ({ accountId, action, badges, domain }) + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} @{getAcct(account, fqn)} diff --git a/src/features/video/index.tsx b/src/features/video/index.tsx index b9697f4ea..27efd8a2c 100644 --- a/src/features/video/index.tsx +++ b/src/features/video/index.tsx @@ -544,6 +544,7 @@ const Video: React.FC = ({ {(detailed || fullscreen) && ( {formatTime(currentTime)} + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} / {formatTime(duration)} diff --git a/src/features/zap/components/zap-pay-request-form.tsx b/src/features/zap/components/zap-pay-request-form.tsx index 6374fbf63..b30c8cb1c 100644 --- a/src/features/zap/components/zap-pay-request-form.tsx +++ b/src/features/zap/components/zap-pay-request-form.tsx @@ -130,6 +130,7 @@ const ZapPayRequestForm = ({ account, status, onClose }: IZapPayRequestForm) => type='text' onChange={handleCustomAmount} value={zapAmount} className='box-shadow:none max-w-20 rounded-none border-0 border-b-4 p-0 text-center !text-2xl font-bold !ring-0 dark:bg-transparent sm:max-w-28 sm:p-0.5 sm:!text-4xl' /> + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} {hasZapSplit &&

sats

}
diff --git a/src/features/zap/components/zap-split-account-item.tsx b/src/features/zap/components/zap-split-account-item.tsx index 8c5520a1a..9e6438432 100644 --- a/src/features/zap/components/zap-split-account-item.tsx +++ b/src/features/zap/components/zap-split-account-item.tsx @@ -23,6 +23,7 @@ export const ZapSplitSlider: React.FC = ({ initialWeight, onWei return (
+ {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} {formattedWeight(value)}% = ({ children }) => { + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} {themeCss && } + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} {['dark', 'black'].includes(theme) && } diff --git a/src/toast.test.tsx b/src/toast.test.tsx index 49f27850a..74c105c2e 100644 --- a/src/toast.test.tsx +++ b/src/toast.test.tsx @@ -13,6 +13,7 @@ function renderApp() { toast, ...render( + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} , , ), diff --git a/src/utils/numbers.tsx b/src/utils/numbers.tsx index 4e3f0f371..a35008c83 100644 --- a/src/utils/numbers.tsx +++ b/src/utils/numbers.tsx @@ -34,6 +34,7 @@ export const shortNumberFormat = (number: any, max?: number): React.ReactNode => } if (max && value > max) { + // eslint-disable-next-line formatjs/no-literal-string-in-jsx return {max}+; }