diff --git a/.eslintrc.js b/.eslintrc.js index d1182628263..35e1423e063 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -75,7 +75,7 @@ module.exports = defineConfig({ ], }, ], - 'no-empty': ['error', { "allowEmptyCatch": true }], + 'no-empty': ['error', { 'allowEmptyCatch': true }], 'no-restricted-properties': [ 'error', { property: 'substring', message: 'Use .slice instead of .substring.' }, @@ -332,16 +332,16 @@ module.exports = defineConfig({ '@typescript-eslint/consistent-type-definitions': ['warn', 'interface'], '@typescript-eslint/consistent-type-exports': 'error', '@typescript-eslint/consistent-type-imports': 'error', - "@typescript-eslint/prefer-nullish-coalescing": ['error', { ignorePrimitives: { boolean: true } }], - "@typescript-eslint/no-restricted-imports": [ - "warn", + '@typescript-eslint/prefer-nullish-coalescing': ['error', { ignorePrimitives: { boolean: true } }], + '@typescript-eslint/no-restricted-imports': [ + 'warn', { - "name": "react-redux", - "importNames": ["useSelector", "useDispatch"], - "message": "Use typed hooks `useAppDispatch` and `useAppSelector` instead." + 'name': 'react-redux', + 'importNames': ['useSelector', 'useDispatch'], + 'message': 'Use typed hooks `useAppDispatch` and `useAppSelector` instead.' } ], - "@typescript-eslint/restrict-template-expressions": ['warn', { allowNumber: true }], + '@typescript-eslint/restrict-template-expressions': ['warn', { allowNumber: true }], 'jsdoc/require-jsdoc': 'off', // Those rules set stricter rules for TS files diff --git a/app/javascript/mastodon/actions/domain_blocks.js b/app/javascript/mastodon/actions/domain_blocks.js index 727f800af3b..4fb31a8bc30 100644 --- a/app/javascript/mastodon/actions/domain_blocks.js +++ b/app/javascript/mastodon/actions/domain_blocks.js @@ -1,10 +1,10 @@ import api, { getLinks } from '../api'; -import { blockDomainSuccess, unblockDomainSuccess } from "./domain_blocks_typed"; +import { blockDomainSuccess, unblockDomainSuccess } from './domain_blocks_typed'; import { openModal } from './modal'; -export * from "./domain_blocks_typed"; +export * from './domain_blocks_typed'; export const DOMAIN_BLOCK_REQUEST = 'DOMAIN_BLOCK_REQUEST'; export const DOMAIN_BLOCK_FAIL = 'DOMAIN_BLOCK_FAIL'; diff --git a/app/javascript/mastodon/actions/interactions.js b/app/javascript/mastodon/actions/interactions.js index b296a5006ac..cf7839848a4 100644 --- a/app/javascript/mastodon/actions/interactions.js +++ b/app/javascript/mastodon/actions/interactions.js @@ -47,7 +47,7 @@ export const UNBOOKMARK_REQUEST = 'UNBOOKMARKED_REQUEST'; export const UNBOOKMARK_SUCCESS = 'UNBOOKMARKED_SUCCESS'; export const UNBOOKMARK_FAIL = 'UNBOOKMARKED_FAIL'; -export * from "./interactions_typed"; +export * from './interactions_typed'; export function favourite(status) { return function (dispatch) { diff --git a/app/javascript/mastodon/actions/notifications.js b/app/javascript/mastodon/actions/notifications.js index 48afb003ad3..f10d218331f 100644 --- a/app/javascript/mastodon/actions/notifications.js +++ b/app/javascript/mastodon/actions/notifications.js @@ -19,11 +19,11 @@ import { } from './importer'; import { submitMarkers } from './markers'; import { decreasePendingNotificationsCount } from './notification_policies'; -import { notificationsUpdate } from "./notifications_typed"; +import { notificationsUpdate } from './notifications_typed'; import { register as registerPushNotifications } from './push_notifications'; import { saveSettings } from './settings'; -export * from "./notifications_typed"; +export * from './notifications_typed'; export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP'; diff --git a/app/javascript/mastodon/actions/timelines.js b/app/javascript/mastodon/actions/timelines.js index f0ea46118e0..5eb37a5550f 100644 --- a/app/javascript/mastodon/actions/timelines.js +++ b/app/javascript/mastodon/actions/timelines.js @@ -158,7 +158,7 @@ export const expandAccountTimeline = (accountId, { maxId, withReplies, t export const expandAccountFeaturedTimeline = (accountId, { tagged } = {}) => expandTimeline(`account:${accountId}:pinned${tagged ? `:${tagged}` : ''}`, `/api/v1/accounts/${accountId}/statuses`, { pinned: true, tagged }); export const expandAccountMediaTimeline = (accountId, { maxId } = {}) => expandTimeline(`account:${accountId}:media`, `/api/v1/accounts/${accountId}/statuses`, { max_id: maxId, only_media: true, limit: 40 }); export const expandListTimeline = (id, { maxId } = {}, done = noOp) => expandTimeline(`list:${id}`, `/api/v1/timelines/list/${id}`, { max_id: maxId }, done); -export const expandLinkTimeline = (url, { maxId } = {}, done = noOp) => expandTimeline(`link:${url}`, `/api/v1/timelines/link`, { url, max_id: maxId }, done); +export const expandLinkTimeline = (url, { maxId } = {}, done = noOp) => expandTimeline(`link:${url}`, '/api/v1/timelines/link', { url, max_id: maxId }, done); export const expandHashtagTimeline = (hashtag, { maxId, tags, local } = {}, done = noOp) => { return expandTimeline(`hashtag:${hashtag}${local ? ':local' : ''}`, `/api/v1/timelines/tag/${hashtag}`, { max_id: maxId, diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx index b5e8dabb7b3..a193e27a4e3 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.jsx +++ b/app/javascript/mastodon/features/compose/components/compose_form.jsx @@ -25,7 +25,7 @@ import { countableText } from '../util/counter'; import { CharacterCounter } from './character_counter'; import { EditIndicator } from './edit_indicator'; import { NavigationBar } from './navigation_bar'; -import { PollForm } from "./poll_form"; +import { PollForm } from './poll_form'; import { ReplyIndicator } from './reply_indicator'; import { UploadForm } from './upload_form'; diff --git a/app/javascript/mastodon/features/emoji/emoji.js b/app/javascript/mastodon/features/emoji/emoji.js index e4aad302f65..7a425a99049 100644 --- a/app/javascript/mastodon/features/emoji/emoji.js +++ b/app/javascript/mastodon/features/emoji/emoji.js @@ -23,7 +23,7 @@ const lightEmoji = emojiFilenames(['👽', '⚾', '🐔', '☁️', '💨', ' * @returns {string} */ const emojiFilename = (filename, colorScheme) => { - const borderedEmoji = colorScheme === "light" ? lightEmoji : darkEmoji; + const borderedEmoji = colorScheme === 'light' ? lightEmoji : darkEmoji; return borderedEmoji.includes(filename) ? (filename + '_border') : filename; }; @@ -104,7 +104,7 @@ const emojifyTextNode = (node, customEmojis) => { if(isSystemTheme) { let source = document.createElement('source'); source.setAttribute('media', '(prefers-color-scheme: dark)'); - source.setAttribute('srcset', `${assetHost}/emoji/${emojiFilename(filename, "dark")}.svg`); + source.setAttribute('srcset', `${assetHost}/emoji/${emojiFilename(filename, 'dark')}.svg`); replacement.appendChild(source); } @@ -114,10 +114,10 @@ const emojifyTextNode = (node, customEmojis) => { img.setAttribute('alt', unicode_emoji); img.setAttribute('title', title); - let theme = "light"; + let theme = 'light'; if(!isSystemTheme && !document.body?.classList.contains('theme-mastodon-light')) - theme = "dark"; + theme = 'dark'; img.setAttribute('src', `${assetHost}/emoji/${emojiFilename(filename, theme)}.svg`); replacement.appendChild(img); diff --git a/app/javascript/mastodon/features/status/components/card.jsx b/app/javascript/mastodon/features/status/components/card.jsx index ee1fbe0f8fe..2ce7fa9ccea 100644 --- a/app/javascript/mastodon/features/status/components/card.jsx +++ b/app/javascript/mastodon/features/status/components/card.jsx @@ -158,7 +158,7 @@ export default class Card extends PureComponent { }; if (largeImage && card.get('type') === 'video') { - thumbnailStyle.aspectRatio = `16 / 9`; + thumbnailStyle.aspectRatio = '16 / 9'; } else if (largeImage) { thumbnailStyle.aspectRatio = '1.91 / 1'; } else { diff --git a/app/javascript/mastodon/features/ui/components/navigation_panel.jsx b/app/javascript/mastodon/features/ui/components/navigation_panel.jsx index 2648923bfc4..7b28dcaac30 100644 --- a/app/javascript/mastodon/features/ui/components/navigation_panel.jsx +++ b/app/javascript/mastodon/features/ui/components/navigation_panel.jsx @@ -121,7 +121,7 @@ class NavigationPanel extends Component { if(transientSingleColumn) banner = (