Commit Graph

6 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
Guangcong Luo
88be8d7b3c
Refactor types for Lowercase<string> (#10377)
TypeScript 4.8+ supports Lowercase for lowercase strings, which isn't
exactly what ID is, but can be used to type IDs in object keys and data
entries that previously required string. I'm calling it IDEntry in places
where it should be an ID but TypeScript doesn't support that.

Very conveniently, no additional casts will be needed when using ID
where IDEntry is expected.

It's caught at least a few bugs, which is also why I'm PRing: I didn't
write the code for the bugs it found, and don't know if it's the right
way to fix them.

This ballooned into several other type refactors.
2024-07-01 15:57:14 -07: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
Kris Johnson
8b9f24e8c1
Remove redundant code from mods/gen1/pokedex.ts (#6629) 2020-04-28 22:17:07 -07:00
Guangcong Luo
42f949a0ed Remove egg group info from Gen 1 Pokédex 2020-04-28 16:25:35 -07:00
Kris Johnson
28bf388b98
Typescript data (#6553) 2020-04-23 09:16:09 -07:00