pokemon-showdown/sim
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
..
examples Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
tools Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
battle-actions.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
battle-queue.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
battle-stream.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
battle.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
dex-abilities.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
dex-conditions.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
dex-data.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
dex-formats.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
dex-items.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
dex-moves.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
dex-species.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
DEX.md Move packed team docs out of PROTOCOL.md 2021-06-10 15:04:25 -07:00
dex.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
field.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
global-types.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
index.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
NONSTANDARD.md Move packed team docs out of PROTOCOL.md 2021-06-10 15:04:25 -07:00
pokemon.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
prng.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
README.md Slightly improve documentation 2021-11-13 14:17:47 -05:00
side.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
SIM-PROTOCOL.md Fix protocol doc for Splash 2023-12-28 20:10:20 -08:00
SIMULATOR.md Slightly improve sim docs for stdio usage 2024-01-17 21:23:20 -08:00
state.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
team-validator.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
TEAMS.md Update packed team Tera Type documentation (#9185) 2022-12-30 13:47:38 -06:00
teams.ts Update to ESLint 9 (#10926) 2025-02-25 20:03:46 -08:00
tsconfig.json Migrate to esbuild for compilation (#9203) 2022-12-22 15:19:29 -06:00

Node.js package

Pokémon Showdown has a Node.js API. It currently only works in Node, not browsers, although we're working on unifying it to work in browsers.

You can install it with the usual:

npm install pokemon-showdown

And you can use it to do the following things:

Simulating battles

See: sim/SIMULATOR.md

Also available as a command-line API!

Validating, generating, and converting teams

See: sim/TEAMS.md

Also available as a command-line API!

Getting Pokédex information

See: sim/DEX.md

Undocumented APIs

Pokémon Showdown's Node.js package has TypeScript definitions for everything it exports, including a lot of undocumented APIs.

Please be aware that any undocumented API is unstable and should not be relied upon not to change. We do not follow semver for undocumented APIs. If you really want to use an undocumented API, remember to pin the exact PS version in your dependencies. You probably also want to follow the API update channel in the Discord server: https://psim.us/devdiscord