Commit Graph

19 Commits

Author SHA1 Message Date
Slayer95
4b8c6a4d6d
Refactor startup (#11346)
Some checks failed
Node.js CI / build (18.x) (push) Has been cancelled
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.
2025-10-17 19:37:47 -07:00
Guangcong Luo
31a4289cc6
Refactor Teams plugin to use lib/database (#11109)
* Refactor Teams.save

Fixes a bug where passwords were changed every time a team was updated.

* Refactor Teams to use lib/database

* Add unit tests

(This found a bug which has also been fixed)

* Test more things

---------

Co-authored-by: Mia <49593536+mia-pi-git@users.noreply.github.com>
2025-08-04 21:51:42 -05: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
Mia
3bec1c0585 Tests: Skip SQLite tests if not installed 2023-01-05 09:29:53 -06:00
Mia
b11177d530
Migrate to esbuild for compilation (#9203) 2022-12-22 15:19:29 -06:00
Mia
ec4cb6a6fa
Support persisting battles in a Postgres database (#8442) 2022-07-22 18:07:10 -07:00
Guangcong Luo
312239cfc2 Fix SQL test 2021-12-03 20:28:22 -05:00
Mia
b66db30c71 Tests: Disable SQL worker wrapper tests if not installed 2021-12-03 17:26:34 -06:00
Mia
77861ceae6
SQL: Use a QueryProcessManager subclass (#8422) 2021-08-14 17:45:51 -07:00
Mia
2c1b7d7828
Add a library for running SQLite databases in threads (#7350) 2021-07-19 21:02:03 -05:00
Annika
c134195915
Use ts-node instead of Sucrase (#8369) 2021-07-09 19:59:22 -07:00
Guangcong Luo
9d87616176
Add more style linting rules (#7537)
* Lint arrow-body-style

* Lint prefer-object-spread

Object spread is faster _and_ more readable.

This also fixes a few unnecessary object clones.

* Enable no-parameter-properties

This isn't currently used, but this makes clear that it shouldn't be.

* Refactor more Promises to async/await

* Remove unnecessary code from getDataMoveHTML etc

* Lint prefer-string-starts-ends-with

* Stop using no-undef

According to the typescript-eslint FAQ, this is redundant with
TypeScript, and they're not wrong. This will save us from needing to
specify globals in two different places which will be nice.
2020-10-19 02:42:28 -07:00
Ben Davies
6f26265ff9 Tests: simplify Dashycode transcodeWithSets helper 2020-10-19 05:15:02 -03:00
Guangcong Luo
229f5f809d Use assert in strict mode
This makes it so we can use `assert.equal` instead of
`assert.strictEqual`, which I think is more readable.
2020-02-20 00:39:31 -08:00
Ben Davies
eaf4b6001d Add more Dashycode tests 2019-07-20 10:50:02 -03:00
Ben Davies
a135ec214a Correct comment about codepoints in Dashycode unit tests 2019-07-13 04:39:38 -03:00
Ben Davies
f5822d9e9f Remove unused parameter from function in Dashycode's unit tests 2019-07-13 02:53:32 -03:00
Ben Davies
e770a565dd Mention why we don't test codepoints above 0xFFFF with Dashycode 2019-07-13 02:45:23 -03:00
Ben Davies
1375d653f9 Unit test Dashycode 2019-07-13 02:42:57 -03:00