Skip to content

Commit f910c8a

Browse files
authored
chore: prettier upgrade (@Miodec) (monkeytypegame#7159)
1 parent 12f206e commit f910c8a

File tree

402 files changed

+3481
-3337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

402 files changed

+3481
-3337
lines changed

.github/workflows/pretty-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
version: ${{ env.PNPM_VERSION }}
3737

3838
- name: Install prettier
39-
run: pnpm add -g prettier@2.8.8
39+
run: pnpm add -g prettier@3.6.2
4040

4141
- name: Get changed files
4242
id: get-changed-files

.github/workflows/pretty-fix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
version: ${{ env.PNPM_VERSION }}
3535

3636
- name: Install prettier
37-
run: pnpm add -g prettier@2.8.8
37+
run: pnpm add -g prettier@3.6.2
3838

3939
- name: Get changed files
4040
id: get-changed-files

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"tabWidth": 2,
33
"useTabs": false,
44
"htmlWhitespaceSensitivity": "ignore",
5+
"trailingComma": "all",
56
"endOfLine": "lf",
67
"overrides": [
78
{

backend/__migration__/testActivity.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ if (require.main === module) {
2727
async function main(): Promise<void> {
2828
try {
2929
console.log(
30-
`Connecting to database ${process.env["DB_NAME"]} on ${process.env["DB_URI"]}...`
30+
`Connecting to database ${process.env["DB_NAME"]} on ${process.env["DB_URI"]}...`,
3131
);
3232

33-
//@ts-ignore
3433
if (!readlineSync.keyInYN("Ready to start migration?")) {
3534
appRunning = false;
3635
}
@@ -222,7 +221,7 @@ async function migrateUsers(uids: string[]): Promise<void> {
222221
},
223222
},
224223
],
225-
{ allowDiskUse: true }
224+
{ allowDiskUse: true },
226225
)
227226
.toArray();
228227
}
@@ -232,19 +231,19 @@ async function handleUsersWithNoResults(uids: string[]): Promise<void> {
232231
{
233232
$and: [{ uid: { $in: uids } }, filter],
234233
},
235-
{ $set: { testActivity: {} } }
234+
{ $set: { testActivity: {} } },
236235
);
237236
}
238237

239238
function updateProgress(
240239
all: number,
241240
current: number,
242241
start: number,
243-
previousBatchSizeTime: number
242+
previousBatchSizeTime: number,
244243
): void {
245244
const percentage = (current / all) * 100;
246245
const timeLeft = Math.round(
247-
(((new Date().valueOf() - start) / percentage) * (100 - percentage)) / 1000
246+
(((new Date().valueOf() - start) / percentage) * (100 - percentage)) / 1000,
248247
);
249248

250249
process.stdout.clearLine?.(0);
@@ -253,7 +252,7 @@ function updateProgress(
253252
`Previous batch took ${Math.round(previousBatchSizeTime)}ms (~${
254253
previousBatchSizeTime / batchSize
255254
}ms per user) ${Math.round(
256-
percentage
257-
)}% done, estimated time left ${timeLeft} seconds.`
255+
percentage,
256+
)}% done, estimated time left ${timeLeft} seconds.`,
258257
);
259258
}

backend/__tests__/__integration__/dal/blocklist.spec.ts

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe("BlocklistDal", () => {
3636
await expect(
3737
BlacklistDal.getCollection().findOne({
3838
emailHash: BlacklistDal.hash(email),
39-
})
39+
}),
4040
).resolves.toMatchObject({
4141
emailHash: BlacklistDal.hash(email),
4242
timestamp: now,
@@ -45,7 +45,7 @@ describe("BlocklistDal", () => {
4545
await expect(
4646
BlacklistDal.getCollection().findOne({
4747
usernameHash: BlacklistDal.hash(name),
48-
})
48+
}),
4949
).resolves.toMatchObject({
5050
usernameHash: BlacklistDal.hash(name),
5151
timestamp: now,
@@ -67,7 +67,7 @@ describe("BlocklistDal", () => {
6767
await expect(
6868
BlacklistDal.getCollection().findOne({
6969
discordIdHash: BlacklistDal.hash(discordId),
70-
})
70+
}),
7171
).resolves.toMatchObject({
7272
discordIdHash: BlacklistDal.hash(discordId),
7373
timestamp: now,
@@ -92,21 +92,21 @@ describe("BlocklistDal", () => {
9292
.find({
9393
usernameHash: BlacklistDal.hash(name),
9494
})
95-
.toArray()
95+
.toArray(),
9696
).resolves.toHaveLength(1);
9797
await expect(
9898
BlacklistDal.getCollection()
9999
.find({
100100
emailHash: BlacklistDal.hash(email),
101101
})
102-
.toArray()
102+
.toArray(),
103103
).resolves.toHaveLength(1);
104104
await expect(
105105
BlacklistDal.getCollection()
106106
.find({
107107
emailHash: BlacklistDal.hash(email2),
108108
})
109-
.toArray()
109+
.toArray(),
110110
).resolves.toHaveLength(1);
111111
});
112112
it("adds user should not create duplicate email", async () => {
@@ -128,7 +128,7 @@ describe("BlocklistDal", () => {
128128
.find({
129129
emailHash: BlacklistDal.hash(email),
130130
})
131-
.toArray()
131+
.toArray(),
132132
).resolves.toHaveLength(1);
133133
});
134134
it("adds user should not create duplicate discordId", async () => {
@@ -153,7 +153,7 @@ describe("BlocklistDal", () => {
153153
.find({
154154
discordIdHash: BlacklistDal.hash(discordId),
155155
})
156-
.toArray()
156+
.toArray(),
157157
).resolves.toHaveLength(1);
158158
});
159159
});
@@ -170,33 +170,33 @@ describe("BlocklistDal", () => {
170170
//by name
171171
await expect(BlacklistDal.contains({ name })).resolves.toBeTruthy();
172172
await expect(
173-
BlacklistDal.contains({ name: name.toUpperCase() })
173+
BlacklistDal.contains({ name: name.toUpperCase() }),
174174
).resolves.toBeTruthy();
175175
await expect(
176-
BlacklistDal.contains({ name, email: "unknown", discordId: "unknown" })
176+
BlacklistDal.contains({ name, email: "unknown", discordId: "unknown" }),
177177
).resolves.toBeTruthy();
178178

179179
//by email
180180
await expect(BlacklistDal.contains({ email })).resolves.toBeTruthy();
181181
await expect(
182-
BlacklistDal.contains({ email: email.toUpperCase() })
182+
BlacklistDal.contains({ email: email.toUpperCase() }),
183183
).resolves.toBeTruthy();
184184
await expect(
185-
BlacklistDal.contains({ name: "unknown", email, discordId: "unknown" })
185+
BlacklistDal.contains({ name: "unknown", email, discordId: "unknown" }),
186186
).resolves.toBeTruthy();
187187

188188
//by discordId
189189
await expect(BlacklistDal.contains({ discordId })).resolves.toBeTruthy();
190190
await expect(
191-
BlacklistDal.contains({ discordId: discordId.toUpperCase() })
191+
BlacklistDal.contains({ discordId: discordId.toUpperCase() }),
192192
).resolves.toBeTruthy();
193193
await expect(
194-
BlacklistDal.contains({ name: "unknown", email: "unknown", discordId })
194+
BlacklistDal.contains({ name: "unknown", email: "unknown", discordId }),
195195
).resolves.toBeTruthy();
196196

197197
//by name and email and discordId
198198
await expect(
199-
BlacklistDal.contains({ name, email, discordId })
199+
BlacklistDal.contains({ name, email, discordId }),
200200
).resolves.toBeTruthy();
201201
});
202202
it("does not contain user", async () => {
@@ -206,20 +206,20 @@ describe("BlocklistDal", () => {
206206

207207
//WHEN / THEN
208208
await expect(
209-
BlacklistDal.contains({ name: "unknown" })
209+
BlacklistDal.contains({ name: "unknown" }),
210210
).resolves.toBeFalsy();
211211
await expect(
212-
BlacklistDal.contains({ email: "unknown" })
212+
BlacklistDal.contains({ email: "unknown" }),
213213
).resolves.toBeFalsy();
214214
await expect(
215-
BlacklistDal.contains({ discordId: "unknown" })
215+
BlacklistDal.contains({ discordId: "unknown" }),
216216
).resolves.toBeFalsy();
217217
await expect(
218218
BlacklistDal.contains({
219219
name: "unknown",
220220
email: "unknown",
221221
discordId: "unknown",
222-
})
222+
}),
223223
).resolves.toBeFalsy();
224224

225225
await expect(BlacklistDal.contains({})).resolves.toBeFalsy();
@@ -243,10 +243,10 @@ describe("BlocklistDal", () => {
243243

244244
//decoy still exists
245245
await expect(
246-
BlacklistDal.contains({ name: "test" })
246+
BlacklistDal.contains({ name: "test" }),
247247
).resolves.toBeTruthy();
248248
await expect(
249-
BlacklistDal.contains({ email: "[email protected]" })
249+
BlacklistDal.contains({ email: "[email protected]" }),
250250
).resolves.toBeTruthy();
251251
});
252252
it("removes existing email", async () => {
@@ -265,10 +265,10 @@ describe("BlocklistDal", () => {
265265

266266
//decoy still exists
267267
await expect(
268-
BlacklistDal.contains({ name: "test" })
268+
BlacklistDal.contains({ name: "test" }),
269269
).resolves.toBeTruthy();
270270
await expect(
271-
BlacklistDal.contains({ email: "[email protected]" })
271+
BlacklistDal.contains({ email: "[email protected]" }),
272272
).resolves.toBeTruthy();
273273
});
274274
it("removes existing discordId", async () => {
@@ -293,13 +293,13 @@ describe("BlocklistDal", () => {
293293

294294
//decoy still exists
295295
await expect(
296-
BlacklistDal.contains({ name: "test" })
296+
BlacklistDal.contains({ name: "test" }),
297297
).resolves.toBeTruthy();
298298
await expect(
299-
BlacklistDal.contains({ email: "[email protected]" })
299+
BlacklistDal.contains({ email: "[email protected]" }),
300300
).resolves.toBeTruthy();
301301
await expect(
302-
BlacklistDal.contains({ discordId: "testDiscordId" })
302+
BlacklistDal.contains({ discordId: "testDiscordId" }),
303303
).resolves.toBeTruthy();
304304
});
305305
it("removes existing username,email and discordId", async () => {
@@ -324,13 +324,13 @@ describe("BlocklistDal", () => {
324324

325325
//decoy still exists
326326
await expect(
327-
BlacklistDal.contains({ name: "test" })
327+
BlacklistDal.contains({ name: "test" }),
328328
).resolves.toBeTruthy();
329329
await expect(
330-
BlacklistDal.contains({ email: "[email protected]" })
330+
BlacklistDal.contains({ email: "[email protected]" }),
331331
).resolves.toBeTruthy();
332332
await expect(
333-
BlacklistDal.contains({ discordId: "testDiscordId" })
333+
BlacklistDal.contains({ discordId: "testDiscordId" }),
334334
).resolves.toBeTruthy();
335335
});
336336

@@ -355,8 +355,8 @@ describe("BlocklistDal", () => {
355355
it("hashes case insensitive", () => {
356356
["test", "TEST", "tESt"].forEach((value) =>
357357
expect(BlacklistDal.hash(value)).toEqual(
358-
"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
359-
)
358+
"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
359+
),
360360
);
361361
});
362362
});

backend/__tests__/__integration__/dal/config.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe("ConfigDal", () => {
2929

3030
//THEN
3131
const savedConfig = (await ConfigDal.getConfig(
32-
uid
32+
uid,
3333
)) as ConfigDal.DBConfig;
3434

3535
expect(savedConfig.config.ads).toBe("off");

0 commit comments

Comments
 (0)