Upgrade Prettier from v2.1.2 to v2.2.1
This commit is contained in:
parent
664865c9f1
commit
a5a64f354f
17 changed files with 50 additions and 101 deletions
|
@ -262,7 +262,7 @@
|
|||
"npm-run-all": "4.1.5",
|
||||
"nyc": "11.4.1",
|
||||
"patch-package": "6.1.2",
|
||||
"prettier": "2.1.2",
|
||||
"prettier": "^2.2.1",
|
||||
"react-docgen-typescript": "1.2.6",
|
||||
"sass-loader": "7.2.0",
|
||||
"sinon": "9.2.4",
|
||||
|
|
|
@ -108,9 +108,10 @@ export const CompositionInput: React.ComponentType<Props> = props => {
|
|||
sortedGroupMembers,
|
||||
} = props;
|
||||
|
||||
const [emojiCompletionElement, setEmojiCompletionElement] = React.useState<
|
||||
JSX.Element
|
||||
>();
|
||||
const [
|
||||
emojiCompletionElement,
|
||||
setEmojiCompletionElement,
|
||||
] = React.useState<JSX.Element>();
|
||||
const [
|
||||
lastSelectionRange,
|
||||
setLastSelectionRange,
|
||||
|
|
|
@ -243,9 +243,7 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
|
||||
public audioButtonRef: React.RefObject<HTMLButtonElement> = React.createRef();
|
||||
|
||||
public reactionsContainerRef: React.RefObject<
|
||||
HTMLDivElement
|
||||
> = React.createRef();
|
||||
public reactionsContainerRef: React.RefObject<HTMLDivElement> = React.createRef();
|
||||
|
||||
public reactionsContainerRefMerger = createRefMerger();
|
||||
|
||||
|
|
|
@ -65,9 +65,10 @@ export const PendingInvites: React.ComponentType<PropsType> = ({
|
|||
}
|
||||
|
||||
const [selectedTab, setSelectedTab] = React.useState(Tab.Requests);
|
||||
const [stagedMemberships, setStagedMemberships] = React.useState<Array<
|
||||
StagedMembershipType
|
||||
> | null>(null);
|
||||
const [
|
||||
stagedMemberships,
|
||||
setStagedMemberships,
|
||||
] = React.useState<Array<StagedMembershipType> | null>(null);
|
||||
|
||||
const allPendingMemberships = conversation.pendingMemberships || [];
|
||||
const allRequestingMemberships =
|
||||
|
|
|
@ -99,12 +99,8 @@ type GenericMediaItemWithSection<T> = {
|
|||
type: T;
|
||||
mediaItem: MediaItemType;
|
||||
};
|
||||
type MediaItemWithStaticSection = GenericMediaItemWithSection<
|
||||
StaticSectionType
|
||||
>;
|
||||
type MediaItemWithYearMonthSection = GenericMediaItemWithSection<
|
||||
YearMonthSectionType
|
||||
> & {
|
||||
type MediaItemWithStaticSection = GenericMediaItemWithSection<StaticSectionType>;
|
||||
type MediaItemWithYearMonthSection = GenericMediaItemWithSection<YearMonthSectionType> & {
|
||||
year: number;
|
||||
month: number;
|
||||
};
|
||||
|
|
|
@ -16,12 +16,8 @@ export type LeftPaneArchivePropsType = {
|
|||
|
||||
/* eslint-disable class-methods-use-this */
|
||||
|
||||
export class LeftPaneArchiveHelper extends LeftPaneHelper<
|
||||
LeftPaneArchivePropsType
|
||||
> {
|
||||
private readonly archivedConversations: ReadonlyArray<
|
||||
ConversationListItemPropsType
|
||||
>;
|
||||
export class LeftPaneArchiveHelper extends LeftPaneHelper<LeftPaneArchivePropsType> {
|
||||
private readonly archivedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
||||
|
||||
constructor({ archivedConversations }: Readonly<LeftPaneArchivePropsType>) {
|
||||
super();
|
||||
|
|
|
@ -31,9 +31,7 @@ export type LeftPaneChooseGroupMembersPropsType = {
|
|||
|
||||
/* eslint-disable class-methods-use-this */
|
||||
|
||||
export class LeftPaneChooseGroupMembersHelper extends LeftPaneHelper<
|
||||
LeftPaneChooseGroupMembersPropsType
|
||||
> {
|
||||
export class LeftPaneChooseGroupMembersHelper extends LeftPaneHelper<LeftPaneChooseGroupMembersPropsType> {
|
||||
private readonly candidateContacts: ReadonlyArray<ConversationType>;
|
||||
|
||||
private readonly cantAddContactForModal:
|
||||
|
|
|
@ -32,9 +32,7 @@ enum TopButton {
|
|||
|
||||
/* eslint-disable class-methods-use-this */
|
||||
|
||||
export class LeftPaneComposeHelper extends LeftPaneHelper<
|
||||
LeftPaneComposePropsType
|
||||
> {
|
||||
export class LeftPaneComposeHelper extends LeftPaneHelper<LeftPaneComposePropsType> {
|
||||
private readonly composeContacts: ReadonlyArray<ContactListItemPropsType>;
|
||||
|
||||
private readonly composeGroups: ReadonlyArray<ConversationListItemPropsType>;
|
||||
|
|
|
@ -19,18 +19,12 @@ export type LeftPaneInboxPropsType = {
|
|||
|
||||
/* eslint-disable class-methods-use-this */
|
||||
|
||||
export class LeftPaneInboxHelper extends LeftPaneHelper<
|
||||
LeftPaneInboxPropsType
|
||||
> {
|
||||
export class LeftPaneInboxHelper extends LeftPaneHelper<LeftPaneInboxPropsType> {
|
||||
private readonly conversations: ReadonlyArray<ConversationListItemPropsType>;
|
||||
|
||||
private readonly archivedConversations: ReadonlyArray<
|
||||
ConversationListItemPropsType
|
||||
>;
|
||||
private readonly archivedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
||||
|
||||
private readonly pinnedConversations: ReadonlyArray<
|
||||
ConversationListItemPropsType
|
||||
>;
|
||||
private readonly pinnedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
||||
|
||||
constructor({
|
||||
conversations,
|
||||
|
|
|
@ -24,9 +24,7 @@ type MaybeLoadedSearchResultsType<T> =
|
|||
| { isLoading: false; results: Array<T> };
|
||||
|
||||
export type LeftPaneSearchPropsType = {
|
||||
conversationResults: MaybeLoadedSearchResultsType<
|
||||
ConversationListItemPropsType
|
||||
>;
|
||||
conversationResults: MaybeLoadedSearchResultsType<ConversationListItemPropsType>;
|
||||
contactResults: MaybeLoadedSearchResultsType<ConversationListItemPropsType>;
|
||||
messageResults: MaybeLoadedSearchResultsType<{
|
||||
id: string;
|
||||
|
@ -40,16 +38,10 @@ const searchResultKeys: Array<
|
|||
'conversationResults' | 'contactResults' | 'messageResults'
|
||||
> = ['conversationResults', 'contactResults', 'messageResults'];
|
||||
|
||||
export class LeftPaneSearchHelper extends LeftPaneHelper<
|
||||
LeftPaneSearchPropsType
|
||||
> {
|
||||
private readonly conversationResults: MaybeLoadedSearchResultsType<
|
||||
ConversationListItemPropsType
|
||||
>;
|
||||
export class LeftPaneSearchHelper extends LeftPaneHelper<LeftPaneSearchPropsType> {
|
||||
private readonly conversationResults: MaybeLoadedSearchResultsType<ConversationListItemPropsType>;
|
||||
|
||||
private readonly contactResults: MaybeLoadedSearchResultsType<
|
||||
ConversationListItemPropsType
|
||||
>;
|
||||
private readonly contactResults: MaybeLoadedSearchResultsType<ConversationListItemPropsType>;
|
||||
|
||||
private readonly messageResults: MaybeLoadedSearchResultsType<{
|
||||
id: string;
|
||||
|
|
|
@ -23,9 +23,7 @@ export type LeftPaneSetGroupMetadataPropsType = {
|
|||
|
||||
/* eslint-disable class-methods-use-this */
|
||||
|
||||
export class LeftPaneSetGroupMetadataHelper extends LeftPaneHelper<
|
||||
LeftPaneSetGroupMetadataPropsType
|
||||
> {
|
||||
export class LeftPaneSetGroupMetadataHelper extends LeftPaneHelper<LeftPaneSetGroupMetadataPropsType> {
|
||||
private readonly groupAvatar: undefined | ArrayBuffer;
|
||||
|
||||
private readonly groupName: string;
|
||||
|
|
12
ts/model-types.d.ts
vendored
12
ts/model-types.d.ts
vendored
|
@ -32,9 +32,7 @@ type DeletesAttributesType = {
|
|||
targetSentTimestamp: number;
|
||||
};
|
||||
|
||||
export declare class DeletesModelType extends Backbone.Model<
|
||||
DeletesAttributesType
|
||||
> {
|
||||
export declare class DeletesModelType extends Backbone.Model<DeletesAttributesType> {
|
||||
forMessage(message: MessageModel): Array<DeletesModelType>;
|
||||
onDelete(doe: DeletesAttributesType): Promise<void>;
|
||||
}
|
||||
|
@ -318,12 +316,8 @@ export type VerificationOptions = {
|
|||
viaSyncMessage?: boolean;
|
||||
};
|
||||
|
||||
export declare class ConversationModelCollectionType extends Backbone.Collection<
|
||||
ConversationModel
|
||||
> {
|
||||
export declare class ConversationModelCollectionType extends Backbone.Collection<ConversationModel> {
|
||||
resetLookups(): void;
|
||||
}
|
||||
|
||||
export declare class MessageModelCollectionType extends Backbone.Collection<
|
||||
MessageModel
|
||||
> {}
|
||||
export declare class MessageModelCollectionType extends Backbone.Collection<MessageModel> {}
|
||||
|
|
|
@ -111,9 +111,8 @@ type CachedIdenticon = {
|
|||
readonly color: ColorType;
|
||||
};
|
||||
|
||||
export class ConversationModel extends window.Backbone.Model<
|
||||
ConversationAttributesType
|
||||
> {
|
||||
export class ConversationModel extends window.Backbone
|
||||
.Model<ConversationAttributesType> {
|
||||
static COLORS: string;
|
||||
|
||||
cachedProps?: ConversationType | null;
|
||||
|
@ -4398,9 +4397,7 @@ export class ConversationModel extends window.Backbone.Model<
|
|||
|
||||
getProfiles(): Promise<Array<void>> {
|
||||
// request all conversation members' keys
|
||||
const conversations = (this.getMembers() as unknown) as Array<
|
||||
ConversationModel
|
||||
>;
|
||||
const conversations = (this.getMembers() as unknown) as Array<ConversationModel>;
|
||||
return Promise.all(
|
||||
window._.map(conversations, conversation => {
|
||||
this.getProfile(conversation.get('uuid'), conversation.get('e164'));
|
||||
|
|
|
@ -3553,7 +3553,9 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
// GroupV1
|
||||
if (!isGroupV2 && dataMessage.group) {
|
||||
const pendingGroupUpdate = [];
|
||||
const memberConversations: Array<typeof window.WhatIsThis> = await Promise.all(
|
||||
const memberConversations: Array<
|
||||
typeof window.WhatIsThis
|
||||
> = await Promise.all(
|
||||
dataMessage.group.membersE164.map((e164: string) =>
|
||||
window.ConversationController.getOrCreateAndWait(
|
||||
e164,
|
||||
|
|
32
ts/textsecure.d.ts
vendored
32
ts/textsecure.d.ts
vendored
|
@ -309,33 +309,19 @@ export declare namespace GroupChangeClass {
|
|||
addMembers?: Array<GroupChangeClass.Actions.AddMemberAction>;
|
||||
deleteMembers?: Array<GroupChangeClass.Actions.DeleteMemberAction>;
|
||||
modifyMemberRoles?: Array<GroupChangeClass.Actions.ModifyMemberRoleAction>;
|
||||
modifyMemberProfileKeys?: Array<
|
||||
GroupChangeClass.Actions.ModifyMemberProfileKeyAction
|
||||
>;
|
||||
addPendingMembers?: Array<
|
||||
GroupChangeClass.Actions.AddMemberPendingProfileKeyAction
|
||||
>;
|
||||
deletePendingMembers?: Array<
|
||||
GroupChangeClass.Actions.DeleteMemberPendingProfileKeyAction
|
||||
>;
|
||||
promotePendingMembers?: Array<
|
||||
GroupChangeClass.Actions.PromoteMemberPendingProfileKeyAction
|
||||
>;
|
||||
modifyMemberProfileKeys?: Array<GroupChangeClass.Actions.ModifyMemberProfileKeyAction>;
|
||||
addPendingMembers?: Array<GroupChangeClass.Actions.AddMemberPendingProfileKeyAction>;
|
||||
deletePendingMembers?: Array<GroupChangeClass.Actions.DeleteMemberPendingProfileKeyAction>;
|
||||
promotePendingMembers?: Array<GroupChangeClass.Actions.PromoteMemberPendingProfileKeyAction>;
|
||||
modifyTitle?: GroupChangeClass.Actions.ModifyTitleAction;
|
||||
modifyAvatar?: GroupChangeClass.Actions.ModifyAvatarAction;
|
||||
modifyDisappearingMessagesTimer?: GroupChangeClass.Actions.ModifyDisappearingMessagesTimerAction;
|
||||
modifyAttributesAccess?: GroupChangeClass.Actions.ModifyAttributesAccessControlAction;
|
||||
modifyMemberAccess?: GroupChangeClass.Actions.ModifyMembersAccessControlAction;
|
||||
modifyAddFromInviteLinkAccess?: GroupChangeClass.Actions.ModifyAddFromInviteLinkAccessControlAction;
|
||||
addMemberPendingAdminApprovals?: Array<
|
||||
GroupChangeClass.Actions.AddMemberPendingAdminApprovalAction
|
||||
>;
|
||||
deleteMemberPendingAdminApprovals?: Array<
|
||||
GroupChangeClass.Actions.DeleteMemberPendingAdminApprovalAction
|
||||
>;
|
||||
promoteMemberPendingAdminApprovals?: Array<
|
||||
GroupChangeClass.Actions.PromoteMemberPendingAdminApprovalAction
|
||||
>;
|
||||
addMemberPendingAdminApprovals?: Array<GroupChangeClass.Actions.AddMemberPendingAdminApprovalAction>;
|
||||
deleteMemberPendingAdminApprovals?: Array<GroupChangeClass.Actions.DeleteMemberPendingAdminApprovalAction>;
|
||||
promoteMemberPendingAdminApprovals?: Array<GroupChangeClass.Actions.PromoteMemberPendingAdminApprovalAction>;
|
||||
modifyInviteLinkPassword?: GroupChangeClass.Actions.ModifyInviteLinkPasswordAction;
|
||||
}
|
||||
}
|
||||
|
@ -1160,9 +1146,7 @@ export declare namespace SyncMessageClass {
|
|||
timestamp?: ProtoBigNumberType;
|
||||
message?: DataMessageClass;
|
||||
expirationStartTimestamp?: ProtoBigNumberType;
|
||||
unidentifiedStatus?: Array<
|
||||
SyncMessageClass.Sent.UnidentifiedDeliveryStatus
|
||||
>;
|
||||
unidentifiedStatus?: Array<SyncMessageClass.Sent.UnidentifiedDeliveryStatus>;
|
||||
isRecipientUpdate?: boolean;
|
||||
}
|
||||
class StickerPackOperation {
|
||||
|
|
|
@ -16284,7 +16284,7 @@
|
|||
"rule": "React-useRef",
|
||||
"path": "ts/components/CompositionInput.tsx",
|
||||
"line": " const callbacksRef = React.useRef(unstaleCallbacks);",
|
||||
"lineNumber": 500,
|
||||
"lineNumber": 501,
|
||||
"reasonCategory": "usageTrusted",
|
||||
"updated": "2021-04-21T21:35:38.757Z"
|
||||
},
|
||||
|
@ -16590,8 +16590,8 @@
|
|||
{
|
||||
"rule": "React-createRef",
|
||||
"path": "ts/components/conversation/Message.tsx",
|
||||
"line": " > = React.createRef();",
|
||||
"lineNumber": 248,
|
||||
"line": " public reactionsContainerRef: React.RefObject<HTMLDivElement> = React.createRef();",
|
||||
"lineNumber": 246,
|
||||
"reasonCategory": "usageTrusted",
|
||||
"updated": "2021-03-05T19:57:01.431Z",
|
||||
"reasonDetail": "Used for detecting clicks outside reaction viewer"
|
||||
|
@ -16927,4 +16927,4 @@
|
|||
"updated": "2021-01-08T15:46:32.143Z",
|
||||
"reasonDetail": "Doesn't manipulate the DOM. This is just a function."
|
||||
}
|
||||
]
|
||||
]
|
||||
|
|
10
yarn.lock
10
yarn.lock
|
@ -13587,16 +13587,16 @@ prettier-linter-helpers@^1.0.0:
|
|||
dependencies:
|
||||
fast-diff "^1.1.2"
|
||||
|
||||
prettier@2.1.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5"
|
||||
integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==
|
||||
|
||||
prettier@^1.19.1:
|
||||
version "1.19.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
|
||||
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
|
||||
|
||||
prettier@^2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
|
||||
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
|
||||
|
||||
pretty-bytes@^1.0.2:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-1.0.4.tgz#0a22e8210609ad35542f8c8d5d2159aff0751c84"
|
||||
|
|
Loading…
Reference in a new issue