Also includes a decent amount of refactoring to bring it in line with Showdown code standards.
---------
Co-authored-by: Slayer95 <ivojulca@hotmail.com>
Most notable in this release:
- TypeScript types are working! (62023bd299)
I don't know if the previous f47e38c5a system worked, but the new one
I've tested and confirmed it does!
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.
* Sim: Use a CSPRNG
* Add test
* fix test prng
* move prng test to others
* fix slight hack
* tf?
* Fuck this
* fucking lol
* fix crap
* i'm going to kill someone
* i hate state
* fix test
* Good work genius
* typo
* Fix exportinputlog
* Refactor for inputlog backwards compatibility
This is a pretty major refactor which is mostly unrelated to the
feature, but it does make the code a lot simpler.
* Readability pass
* Readability (again)
* Remove sodium-native dependency
* Refactor to serialize seeds in hex strings
(Also removes the Buffer dependency from PRNG, and slightly improves
comments.)
* Apparently << is 32-bit signed
* Readability
---------
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
`full-test-ci` receives a list of modified (including deleted) files,
but eslint complains when it tries to lint a nonexistent file.
Fortunately, it has a flag to ignore missing files which we can
just use here.
Previous NPM package had a postinstall script that made it fail to
install. This fixes that.
TypeScript types still aren't working, as I suspected. That will
come in a future version.
Now that [`lint` and `full-lint` use the same configuration](c57fcf25c6), the only difference between them is the `--max-warnings` flag.
This separation causes some problems:
- In small terminal windows, warnings can be obscured by terminal scroll due to the large volume of unit tests. These warnings in turn cause CI failures since GitHub Actions runs `full-lint`.
- When changes to the linting script need to be made, **three** scripts need to be updated. This can lead to oversights such as `full-lint` not being updated for `.tsx` files when JSX support was added.
The `no-extraneous-dependencies` rule conflicts with the way we use
`node-oom-heapdump`.
It also isn't even the kind of dependency linting we need! It's
obvious when we forget to include a dependency (CI will tell us), it's
forgetting to remove a dependency that can stick around unnoticed.
Anyway, this allows us to remove the entirety of `eslint-plugin-import`.
Yay for cutting down dependencies?