chore: bump Prettier to the latest (#4185)

This commit is contained in:
Lipis 2021-11-01 15:24:05 +02:00 committed by GitHub
parent 277ffaacb9
commit 1c7056bdaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 226 additions and 284 deletions

View file

@ -419,12 +419,8 @@ class CollabWrapper extends PureComponent<Props, CollabState> {
);
break;
case "MOUSE_LOCATION": {
const {
pointer,
button,
username,
selectedElementIds,
} = decryptedData.payload;
const { pointer, button, username, selectedElementIds } =
decryptedData.payload;
const socketId: SocketUpdateDataSource["MOUSE_LOCATION"]["payload"]["socketId"] =
decryptedData.payload.socketId ||
// @ts-ignore legacy, see #2094 (#2097)
@ -503,12 +499,10 @@ class CollabWrapper extends PureComponent<Props, CollabState> {
};
private loadImageFiles = throttle(async () => {
const {
loadedFiles,
erroredFiles,
} = await this.fetchImageFilesFromFirebase({
elements: this.excalidrawAPI.getSceneElementsIncludingDeleted(),
});
const { loadedFiles, erroredFiles } =
await this.fetchImageFilesFromFirebase({
elements: this.excalidrawAPI.getSceneElementsIncludingDeleted(),
});
this.excalidrawAPI.addFiles(loadedFiles);
@ -591,9 +585,8 @@ class CollabWrapper extends PureComponent<Props, CollabState> {
setCollaborators(sockets: string[]) {
this.setState((state) => {
const collaborators: InstanceType<
typeof CollabWrapper
>["collaborators"] = new Map();
const collaborators: InstanceType<typeof CollabWrapper>["collaborators"] =
new Map();
for (const socketId of sockets) {
if (this.collaborators.has(socketId)) {
collaborators.set(socketId, this.collaborators.get(socketId)!);
@ -695,7 +688,8 @@ class CollabWrapper extends PureComponent<Props, CollabState> {
this.contextValue.initializeSocketClient = this.initializeSocketClient;
this.contextValue.onCollabButtonClick = this.onCollabButtonClick;
this.contextValue.broadcastElements = this.broadcastElements;
this.contextValue.fetchImageFilesFromFirebase = this.fetchImageFilesFromFirebase;
this.contextValue.fetchImageFilesFromFirebase =
this.fetchImageFilesFromFirebase;
return this.contextValue;
};

View file

@ -210,8 +210,8 @@ class Portal {
socketId: this.socket.id,
pointer: payload.pointer,
button: payload.button || "up",
selectedElementIds: this.collab.excalidrawAPI.getAppState()
.selectedElementIds,
selectedElementIds:
this.collab.excalidrawAPI.getAppState().selectedElementIds,
username: this.collab.state.username,
},
};

View file

@ -54,9 +54,8 @@ export const reconcileElements = (
remoteElements: readonly BroadcastedExcalidrawElement[],
localAppState: AppState,
): ReconciledElements => {
const localElementsData = getElementsMapWithIndex<ExcalidrawElement>(
localElements,
);
const localElementsData =
getElementsMapWithIndex<ExcalidrawElement>(localElements);
const reconciledElements: ExcalidrawElement[] = localElements.slice();

View file

@ -14,9 +14,8 @@ export const GitHubCorner = React.memo(
className="rtl-mirror"
style={{
marginTop: "calc(var(--space-factor) * -1)",
[dir === "rtl"
? "marginLeft"
: "marginRight"]: "calc(var(--space-factor) * -1)",
[dir === "rtl" ? "marginLeft" : "marginRight"]:
"calc(var(--space-factor) * -1)",
}}
>
<a

View file

@ -31,15 +31,11 @@ export class FileManager {
getFiles,
saveFiles,
}: {
getFiles: (
fileIds: FileId[],
) => Promise<{
getFiles: (fileIds: FileId[]) => Promise<{
loadedFiles: BinaryFileData[];
erroredFiles: Map<FileId, true>;
}>;
saveFiles: (data: {
addedFiles: Map<FileId, BinaryFileData>;
}) => Promise<{
saveFiles: (data: { addedFiles: Map<FileId, BinaryFileData> }) => Promise<{
savedFiles: Map<FileId, true>;
erroredFiles: Map<FileId, true>;
}>;

View file

@ -13,9 +13,8 @@ import { MIME_TYPES } from "../../constants";
const FIREBASE_CONFIG = JSON.parse(process.env.REACT_APP_FIREBASE_CONFIG);
let firebasePromise: Promise<
typeof import("firebase/app").default
> | null = null;
let firebasePromise: Promise<typeof import("firebase/app").default> | null =
null;
let firestorePromise: Promise<any> | null | true = null;
let firebaseStoragePromise: Promise<any> | null | true = null;

View file

@ -78,9 +78,10 @@ export type SocketUpdateDataIncoming =
type: "INVALID_RESPONSE";
};
export type SocketUpdateData = SocketUpdateDataSource[keyof SocketUpdateDataSource] & {
_brand: "socketUpdateData";
};
export type SocketUpdateData =
SocketUpdateDataSource[keyof SocketUpdateDataSource] & {
_brand: "socketUpdateData";
};
export const encryptAESGEM = async (
data: Uint8Array,

View file

@ -286,7 +286,8 @@ const ExcalidrawWrapper = () => {
promise: ResolvablePromise<ImportedDataState | null>;
}>({ promise: null! });
if (!initialStatePromiseRef.current.promise) {
initialStatePromiseRef.current.promise = resolvablePromise<ImportedDataState | null>();
initialStatePromiseRef.current.promise =
resolvablePromise<ImportedDataState | null>();
}
useEffect(() => {
@ -296,10 +297,8 @@ const ExcalidrawWrapper = () => {
}, VERSION_TIMEOUT);
}, []);
const [
excalidrawAPI,
excalidrawRefCallback,
] = useCallbackRefState<ExcalidrawImperativeAPI>();
const [excalidrawAPI, excalidrawRefCallback] =
useCallbackRefState<ExcalidrawImperativeAPI>();
const collabAPI = useContext(CollabContext)?.api;