Update prettier to 3.3.3

This commit is contained in:
Fedor Indutny 2024-07-23 17:31:40 -07:00 committed by GitHub
parent 1773ad1e11
commit 24a22bf191
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
109 changed files with 452 additions and 392 deletions

View file

@ -92,7 +92,7 @@ const createActiveDirectCallProp = (
hasRemoteVideo: boolean;
presenting: boolean;
title: string;
}
},
],
});

View file

@ -174,8 +174,8 @@ export function CallingLobby({
const videoButtonType = hasLocalVideo
? CallingButtonType.VIDEO_ON
: availableCameras.length === 0
? CallingButtonType.VIDEO_DISABLED
: CallingButtonType.VIDEO_OFF;
? CallingButtonType.VIDEO_DISABLED
: CallingButtonType.VIDEO_OFF;
const audioButtonType = hasLocalAudio
? CallingButtonType.AUDIO_ON

View file

@ -397,9 +397,8 @@ function CustomColorBubble({
event.stopPropagation();
event.preventDefault();
const conversations = await getConversationsWithCustomColor(
colorId
);
const conversations =
await getConversationsWithCustomColor(colorId);
if (!conversations.length) {
onDelete();
} else {

View file

@ -506,7 +506,12 @@ export const CompositionArea = memo(function CompositionArea({
) {
inputApiRef.current.reset();
}
}, [messageCompositionId, sendCounter, previousMessageCompositionId, previousSendCounter]);
}, [
messageCompositionId,
sendCounter,
previousMessageCompositionId,
previousSendCounter,
]);
const insertEmoji = useCallback(
(e: EmojiPickDataType) => {

View file

@ -129,7 +129,7 @@ export const ConfirmationDialog = React.memo(function ConfirmationDialogInner({
<Button
key={
typeof action.text === 'string'
? action.id ?? action.text
? (action.id ?? action.text)
: action.id
}
disabled={action.disabled || isSpinning}

View file

@ -23,7 +23,7 @@ export type PropsType = Readonly<{
const UNITS = ['seconds', 'minutes', 'hours', 'days', 'weeks'] as const;
export type Unit = typeof UNITS[number];
export type Unit = (typeof UNITS)[number];
const UNIT_TO_SEC = new Map<Unit, number>([
['seconds', 1],

View file

@ -26,7 +26,7 @@ const createAttachment = (
contentType: stringToMIMEType(props.contentType ?? ''),
fileName: props.fileName ?? '',
screenshotPath: props.pending === false ? props.screenshotPath : undefined,
url: props.pending === false ? props.url ?? '' : '',
url: props.pending === false ? (props.url ?? '') : '',
size: 3433,
});

View file

@ -637,7 +637,7 @@ function stableParticipantComparator(
}
type ParticipantsInPageType<
T extends { videoAspectRatio: number } = ParticipantTileType
T extends { videoAspectRatio: number } = ParticipantTileType,
> = {
rows: Array<Array<T>>;
numParticipants: number;

View file

@ -320,7 +320,7 @@ export function MediaEditor({
const objectShortcuts: Array<
[
(ev: KeyboardEvent) => boolean,
(obj: fabric.Object, ev: KeyboardEvent) => unknown
(obj: fabric.Object, ev: KeyboardEvent) => unknown,
]
> = [
[
@ -1353,9 +1353,8 @@ export function MediaEditor({
let data: Uint8Array;
let blurHash: string;
try {
const renderFabricCanvas = await cloneFabricCanvas(
fabricCanvas
);
const renderFabricCanvas =
await cloneFabricCanvas(fabricCanvas);
renderFabricCanvas.remove(
...renderFabricCanvas

View file

@ -6,7 +6,7 @@ import React from 'react';
export abstract class PureComponentProfiler<
Props extends Record<string, unknown>,
State extends Record<string, unknown>
State extends Record<string, unknown>,
> extends React.Component<Props, State> {
public override shouldComponentUpdate(
nextProps: Props,

View file

@ -70,7 +70,7 @@ const createProps = (overrideProps: Partial<PropsType> = {}): PropsType => ({
i18n,
safetyNumber:
'safetyNumber' in overrideProps
? overrideProps.safetyNumber ?? null
? (overrideProps.safetyNumber ?? null)
: {
numberBlocks: generateNumberBlocks(),
qrData: generateQRData(),

View file

@ -7,7 +7,7 @@ import classNames from 'classnames';
import { getClassNamesFor } from '../util/getClassNamesFor';
export const SpinnerSvgSizes = ['small', 'normal'] as const;
export type SpinnerSvgSize = typeof SpinnerSvgSizes[number];
export type SpinnerSvgSize = (typeof SpinnerSvgSizes)[number];
export const SpinnerDirections = [
'outgoing',
@ -17,7 +17,7 @@ export const SpinnerDirections = [
'on-progress-dialog',
'on-avatar',
] as const;
export type SpinnerDirection = typeof SpinnerDirections[number];
export type SpinnerDirection = (typeof SpinnerDirections)[number];
export type Props = {
ariaLabel?: string;

View file

@ -5,7 +5,7 @@ import React from 'react';
import classNames from 'classnames';
export const SpinnerSvgSizes = ['small', 'normal'] as const;
export type SpinnerSvgSize = typeof SpinnerSvgSizes[number];
export type SpinnerSvgSize = (typeof SpinnerSvgSizes)[number];
export type Props = {
className?: string;

View file

@ -93,7 +93,8 @@ const BackgroundStyle = {
},
};
type BackgroundStyleType = typeof BackgroundStyle[keyof typeof BackgroundStyle];
type BackgroundStyleType =
(typeof BackgroundStyle)[keyof typeof BackgroundStyle];
function getBackground(
bgStyle: BackgroundStyleType

View file

@ -269,7 +269,7 @@ function createCanvasAndContext({
height,
}: CreateCanvasAndContextOptionsType): [
OffscreenCanvas,
OffscreenCanvasRenderingContext2D
OffscreenCanvasRenderingContext2D,
] {
const canvas = new OffscreenCanvas(
PRINT_PIXEL_RATIO * width,

View file

@ -456,7 +456,7 @@ function HeaderContent({
sharedGroupNames={sharedGroupNames}
size={AvatarSize.THIRTY_TWO}
// user may have stories, but we don't show that on Note to Self conversation
storyRing={conversation.isMe ? undefined : hasStories ?? undefined}
storyRing={conversation.isMe ? undefined : (hasStories ?? undefined)}
theme={theme}
title={conversation.title}
unblurredAvatarUrl={conversation.unblurredAvatarUrl ?? undefined}

View file

@ -162,10 +162,10 @@ export const MessageStatuses = [
'sent',
'viewed',
] as const;
export type MessageStatusType = typeof MessageStatuses[number];
export type MessageStatusType = (typeof MessageStatuses)[number];
export const Directions = ['incoming', 'outgoing'] as const;
export type DirectionType = typeof Directions[number];
export type DirectionType = (typeof Directions)[number];
export type AudioAttachmentProps = {
renderingContext: string;

View file

@ -34,7 +34,7 @@ export const MessageStatuses = [
'partial-sent',
] as const;
export type MessageStatusType = typeof MessageStatuses[number];
export type MessageStatusType = (typeof MessageStatuses)[number];
export type PropsData = Pick<
ConversationType,

View file

@ -8,7 +8,7 @@ import { emojiToImage, getImagePath } from './lib';
export const EmojiSizes = [16, 18, 20, 24, 28, 32, 48, 64, 66] as const;
export type EmojiSizeType = typeof EmojiSizes[number];
export type EmojiSizeType = (typeof EmojiSizes)[number];
export type OwnProps = {
emoji?: string;

View file

@ -76,7 +76,7 @@ const categories = [
'flag',
] as const;
type Category = typeof categories[number];
type Category = (typeof categories)[number];
export const EmojiPicker = React.memo(
React.forwardRef<HTMLDivElement, Props>(