This minimizes side effects of import/require across the codebase,
and lets the caller be responsible of initializing child processeses,
as well as other async logic, such as restoring saved battles.
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.
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
This replaces some pretty jank code with much cleaner code.
Anything that would be more cleanly implemented by iterating the
players array is now done by iterating the players array.
Some instances of p1/p2 are lying around but we should slowly deprecate
them.
* Prevent guessing words with incorrect already revealed indexes
* Clarify hint length and use consts
* Escape HTML on words
* lint
* Hangman: Better testing for invalid guesses
* Hangman: Escape HTML characters
Co-authored-by: Leonard Craft III <leonardcraft64@gmail.com>
(Also mark them with "(slow)" to skip them during a normal `npm test`.)
This is mostly the result of a particularly frustrating debugging
session when I couldn't figure out why these tests were timing out
(it turns out, it was because my DNS was broken so `IPTools.lookup` was
timing out). Marking them with "(network)" should make similar
situations less frustrating in the future.