Commit Graph

13 Commits

Author SHA1 Message Date
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
pyuk-bot
7bb2fd1869
Overhaul 'SwitchIn' event for more accurate effect resolution order (#10766) 2025-01-28 16:51:17 -06:00
Kris Johnson
10e6529eeb Revert "Redo #8134"
This reverts commit 1e8c0c183f.
2024-01-31 09:48:15 -07:00
Guangcong Luo
1e8c0c183f Redo #8134
We usually do data changes in scripts rather than in Dex, so the
changes in #8134 were a nonstandard approach. I think I just
was not thinking when I merged that PR.
2024-01-29 12:35:24 +09:00
Karthik
06d88748a5
Refactor STAB (again) (#10099) 2024-01-13 23:48:47 -06:00
Karthik
100e511b07
Gen IV: Fix client messages for spread move miss (#8507) 2021-10-28 18:49:00 -05:00
Guangcong Luo
44ef998ecc Implement free-for-all
This involves a huge refactor for how battles are constructed, but
it's totally worth it.

Currently, tournaments, challenges, and laddering are unsupported; only
unrated searches work. But it does work, and it's beautiful.
2021-04-01 04:44:16 -07:00
Guangcong Luo
ed454ef76a
Refactor scripts to battle-actions (#8138)
This introduces a new class, BattleActions, available as `battle.actions`,
moving all functions from `data/scripts.ts` to `sim/battle-actions.ts`.

This makes it so that "go to definition" will now work correctly for
functions previously in scripts; we no longer need UnimplementedError,
and there's now a clean conceptual separation between `battle` and
`battle-actions` (whereas the previous distinction between `battle` and
`scripts` was basically nonexistent).

This will be a difficult migration if you maintain a fork with custom
scripted mods. I'm sorry! Migration instructions are here:

https://github.com/smogon/pokemon-showdown/pull/8138
2021-03-28 12:01:38 -07:00
Kris Johnson
5e6c259dec
Gen 3/4: Remove HAs in getSpecies (#8134) 2021-03-23 10:19:50 -07:00
urkerab
74ae95a91c
Update accuracy calculation for latest Gen 7 research (#7806) 2020-12-15 18:37:24 -05:00
Guangcong Luo
2f805c93a2
Remove "Battle" prefix from data exports (#7039)
`BattlePokedex` is now `Pokedex`, `BattleItems` is now `Items`, etc.

I also renamed `Movedex` to `Moves` and `Statuses` to `Conditions`.

`TypeChart` isn't `Types` yet, because unlike the others, it's not
indexed by ID. That should probably be fixed one day.
2020-07-24 12:42:26 -07:00
Mia
6839a1f4db
Add a library for utility functions (#6817) 2020-06-09 22:06:43 -07:00
Kris Johnson
28bf388b98
Typescript data (#6553) 2020-04-23 09:16:09 -07:00