浏览代码

Use @excalidraw/prettier-config

master
Panayiotis Lipiridis 4 年前
父节点
当前提交
637e0df159
共有 4 个文件被更改,包括 13 次插入9 次删除
  1. 0
    3
      .prettierrc
  2. 3
    1
      package.json
  3. 4
    4
      src/index.ts
  4. 6
    1
      yarn.lock

+ 0
- 3
.prettierrc 查看文件

@@ -1,3 +0,0 @@
1
-{
2
-  "proseWrap": "never"
3
-}

+ 3
- 1
package.json 查看文件

@@ -1,6 +1,6 @@
1 1
 {
2
-  "name": "excalidraw-portal",
3 2
   "dependencies": {
3
+    "@excalidraw/prettier-config": "1.0.1",
4 4
     "@types/debug": "4.1.5",
5 5
     "@types/express": "4.17.11",
6 6
     "@types/node": "14.14.31",
@@ -14,6 +14,8 @@
14 14
   },
15 15
   "license": "MIT",
16 16
   "main": "dist/index.js",
17
+  "name": "excalidraw-portal",
18
+  "prettier": "@excalidraw/prettier-config",
17 19
   "scripts": {
18 20
     "build": "tsc",
19 21
     "format": "yarn prettier --write",

+ 4
- 4
src/index.ts 查看文件

@@ -48,7 +48,7 @@ io.on("connection", (socket) => {
48 48
     }
49 49
     io.in(roomID).emit(
50 50
       "room-user-change",
51
-      Object.keys(io.sockets.adapter.rooms[roomID].sockets)
51
+      Object.keys(io.sockets.adapter.rooms[roomID].sockets),
52 52
     );
53 53
   });
54 54
 
@@ -57,7 +57,7 @@ io.on("connection", (socket) => {
57 57
     (roomID: string, encryptedData: ArrayBuffer, iv: Uint8Array) => {
58 58
       socketDebug(`${socket.id} sends update to ${roomID}`);
59 59
       socket.broadcast.to(roomID).emit("client-broadcast", encryptedData, iv);
60
-    }
60
+    },
61 61
   );
62 62
 
63 63
   socket.on(
@@ -67,14 +67,14 @@ io.on("connection", (socket) => {
67 67
       socket.volatile.broadcast
68 68
         .to(roomID)
69 69
         .emit("client-broadcast", encryptedData, iv);
70
-    }
70
+    },
71 71
   );
72 72
 
73 73
   socket.on("disconnecting", () => {
74 74
     const rooms = io.sockets.adapter.rooms;
75 75
     for (const roomID in socket.rooms) {
76 76
       const clients = Object.keys(rooms[roomID].sockets).filter(
77
-        (id) => id !== socket.id
77
+        (id) => id !== socket.id,
78 78
       );
79 79
       if (clients.length > 0) {
80 80
         socket.broadcast.to(roomID).emit("room-user-change", clients);

+ 6
- 1
yarn.lock 查看文件

@@ -2,6 +2,11 @@
2 2
 # yarn lockfile v1
3 3
 
4 4
 
5
+"@excalidraw/prettier-config@^1.0.1":
6
+  version "1.0.1"
7
+  resolved "https://registry.yarnpkg.com/@excalidraw/prettier-config/-/prettier-config-1.0.1.tgz#e7dd900993fe2f4442196805c124b43d9e361be5"
8
+  integrity sha512-AktpMzImIKlIfd0WYfuMcBovPL8C56LZdMqc7om05l8F3AjH0lffUctqQr3uu9e3t8NIZM7tEIZsiqZ+XO0fRQ==
9
+
5 10
 "@types/body-parser@*":
6 11
   version "1.19.0"
7 12
   resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.0.tgz#0685b3c47eb3006ffed117cdd55164b61f80538f"
@@ -921,7 +926,7 @@ pinkie@^2.0.0:
921 926
   resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
922 927
   integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA=
923 928
 
924
-prettier@2.2.1:
929
+prettier@^2.2.1:
925 930
   version "2.2.1"
926 931
   resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
927 932
   integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==

正在加载...
取消
保存