Commit Graph

41 Commits

Author SHA1 Message Date
Guangcong Luo
73a04cdcba TypeScript: Enable noImplicitOverride
Some checks are pending
Publish to npm / test (push) Waiting to run
Publish to npm / get-version (push) Waiting to run
Publish to npm / npm-publish (push) Blocked by required conditions
Node.js CI / build (18.x) (push) Waiting to run
2025-02-26 14:38:32 -08:00
Guangcong Luo
78439b4a02
Update to ESLint 9 (#10926)
ESLint has a whole new config format, so I figure it's a good time to
make the config system saner.

- First, we no longer have separate eslint-no-types configs. Lint
  performance shouldn't be enough of a problem to justify the
  relevant maintenance complexity.

- Second, our base config should work out-of-the-box now. `npx eslint`
  will work as expected, without any CLI flags. You should still use
  `npm run lint` which adds the `--cached` flag for performance.

- Third, whatever updates I did fixed style linting, which apparently
  has been bugged for quite some time, considering all the obvious
  mixed-tabs-and-spaces issues I found in the upgrade.

Also here are some changes to our style rules. In particular:

- Curly brackets (for objects etc) now have spaces inside them. Sorry
  for the huge change. ESLint doesn't support our old style, and most
  projects use Prettier style, so we might as well match them in this way.
  See https://github.com/eslint-stylistic/eslint-stylistic/issues/415

- String + number concatenation is no longer allowed. We now
  consistently use template strings for this.
2025-02-25 20:03:46 -08:00
dot-Comfey
69eac3893e
Trivia: Fix crash and Number mode game cap (#10753)
* Trivia: Fix crash and Number mode game cap

Discussed with Trivia auth.

Fixes an issue in Number mode where the game fails to end after a specified amount of questions, and fixes a crash caused by ending a game with no participation

* Update server/chat-plugins/trivia/trivia.ts

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>

---------

Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
2025-01-04 13:15:05 -07:00
Mia
e82c5fa161 Change references of & to ~ 2024-10-01 09:02:03 -05:00
Annika
a6a2f2a487 Trivia: Fix official-ending message 2024-08-22 05:26:21 +00:00
Guangcong Luo
cec317671e Cleanup RoomGame implementations again
This reinstates the recently-reverted RoomGame refactor/cleanup, but
with the bugs (forfeiting BestOfGame, and autojoin) fixed.

This reinstates:

- 6bccd4f622 Fix crash in bestof when expiring battles
- 2a48cbd064 Cleanup more RoomGame implementations

The latter fixes these, in addition to refactoring:
- Fix a race condition when destroying bestof games
- Fix `/tour settings scouting off` error message
2024-01-16 15:54:38 +09:00
Leonard Craft III
5252aa7d7e Revert "Cleanup more battle implementations"
This reverts commit 2a48cbd064.
2024-01-15 13:38:01 -06:00
Guangcong Luo
2a48cbd064 Cleanup more battle implementations
This is mostly just refactoring, but the refactor caught a few bugs:

- Fix a race condition when destroying bestof games
- Fix `/tour settings scouting off` error message
2024-01-15 23:58:46 +09:00
Guangcong Luo
eb0ef53e0e
Remove unlinkUser (#10101)
This refactor removes `player.unlinkUser()` which was used for several
unrelated use cases.

These have been split apart into:

- at the end of a game, `game.setEnded()` now clears `user.games`,
  while leaving `player.id` untouched
- when trying to change the user associated with the player, we now
  consistently use the higher-level `game.updatePlayer()`

There's a good chance this fixes the lagspikes currently affecting PS.
2024-01-08 20:49:34 -08:00
Annika
27a9150dba
Trivia: Log questions during acceptance 2024-01-07 18:42:46 -08:00
Annika
280745a9f4
Trivia: Implement command to search for questions with 2 spaces 2024-01-07 18:36:03 -08:00
Annika
a8104067ef
Trivia: Make /trivia move accept multiline input 2024-01-07 17:58:42 -08:00
Annika
0b8ec41d4f Trivia: QW bug fixes 2022-12-01 20:45:21 -05:00
Annika
68b98695e6 Trivia: Add old AE/SG/SH/Pokémon categories 2022-11-23 12:17:51 -08:00
Annika
2b5fb7587d /trivia history: Don't duplicate category names 2022-09-23 10:02:08 -07:00
Annika
b0c75d7ccf Trivia: Allow all categories 2022-09-23 09:59:43 -07:00
Annika
e7a71e9c4a Trivia: Support combining all with subcats 2022-09-10 15:42:49 -07:00
Annika
564cd7b5ba Trivia: Don't add unranked games to history 2022-09-05 16:20:10 -07:00
Annika
86b5309446 Trivia: Add categories to QW moderator actions 2022-05-18 18:44:47 -07:00
Annika
0a1c4d1b87 Trivia: Fix duplicate messages 2022-04-11 18:25:52 -07:00
Annika
77bf9d74ad Trivia: Display top players at end of Timer/Number 2022-04-10 15:21:59 -07:00
Alexander B
0475b38ae8
RoomGame: Refactor to use generic typing (#8678) 2022-03-13 18:01:54 -07:00
Annika
640cdcab21 Fix bug in /trivia edit 2022-02-04 23:09:42 -05:00
Annika
eef1d718e5 Trivia: Don't select First as a random mode 2022-02-04 18:07:44 -08:00
Annika
5be146e5f6 /trivia edit: Fix HTML escaping 2022-01-15 14:21:09 -08:00
Annika
17806788bf Trivia: Add editing command 2022-01-14 20:32:45 -08:00
Annika
d189206088 Trivia: Update help to reflect new ladder length 2022-01-10 11:46:26 -08:00
Annika
cb1104afc5 Trivia: Update help 2022-01-05 16:53:11 -08:00
Annika
a412bd8d88 Trivia: Display /trivia rank as a table 2022-01-05 16:51:09 -08:00
Annika
ad77c5d9ef Trivia: Rename leaderboard commands 2022-01-05 15:45:18 -08:00
Annika
6c8db6446f Trivia: Show up to 500 users in /trivia rank 2021-12-11 20:47:56 -08:00
Annika
57f19246a8 Trivia: Support a cycle-specific leaderboard 2021-12-11 18:13:20 -08:00
Annika
63e7d70e17 Trivia: Fix question order in officials 2021-12-10 19:21:15 -08:00
Annika
260fc6c176 Trivia: Fix question order 2021-09-12 12:16:38 -07:00
Mia
7811795344
Handle new TypeScript version (#8449)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-08-30 20:11:44 -07:00
Annika
299c883ed0 Trivia: Fix 'all' and 'random' fishes 2021-08-20 18:08:04 -07:00
Annika
222745920a Fix CI 2021-08-16 12:03:05 -07:00
Annika
153f223e88
Trivia: Fix type error 2021-08-16 09:20:14 -07:00
Annika
d18993d3c3
Trivia: Attempt to make 'all' fishes work
I hate coding on crappy high school Chromebooks
2021-08-16 09:12:01 -07:00
Annika
7213dec936 Trivia: Add generic storage interface 2021-08-14 20:35:08 -07:00
Annika
0a33b52ad4 Trivia: Use transactions and split into a directory 2021-08-14 20:35:08 -07:00