Commit Graph

6 Commits

Author SHA1 Message Date
Guangcong Luo
5b97740c80 Fix overlooked paths from directory reorg 2023-11-16 22:51:31 +00:00
Kirk Scheibelhut
575bad1cf9 toId -> toID
Zarel/Pokemon-Showdown#5479
2019-05-14 09:54:18 -07:00
Guangcong Luo
2471482fb4 Battle.lineParse -> BattleTextParser.parseLine
BattleTextParser.parseLine -> BattleTextParser.parseArgs

This makes it so Battle depends on BattleTextParser, rather than
BattleTextParser depending on Battle.

This is probably better, because someone is way more likely to want
BattleTextParser standalone, than to want Battle standalone.

...which I'm sure matters to literally no one but me, but whatever. I
think it makes more sense this way.
2019-01-05 05:41:05 -06:00
Guangcong Luo
d05fe62375 Use require instead of eval in ./test/parse
I still don't like how everything's a global in Node, but for now we
don't have a better solution.
2019-01-05 05:15:37 -06:00
Guangcong Luo
38b66272f2 Fix issues identified by LGTM
Out of 12 issues found:

3 bugs:

- duplicate property - caught a bug in Gen 1 Light Screen
- duplicate property - caught a bug in Gen 1 Reflect
- unused variable - caught a bug in type animations

7 harmless but good for code quality:

- unused variable - harmless but good for code quality
- unused variable - harmless but good for code quality
- unused variable - harmless but good for code quality
- unused variable - harmless but good for code quality
- duplicate case - harmless but important for code quality
- unused variable - harmless but good for code quality
- unused variable - harmless but important for code quality

2 not-bugs that had to be worked around:

- unused variable - used for an `eval` trick, had to use a workaround
- unused variable - used for readable destructuring

I think on balance, LGTM does more good than bad. Catching bugs early
is worth some amount of hassle.

(Also like half these problems are problems tslint could catch if I
actually bothered to set it up...)
2018-11-15 18:52:53 -06:00
Guangcong Luo
aa2eecb7cc Add script for testing the new battle parser
(Run `./test/parse` and pipe protocol messages to stdin.)
2018-11-15 18:52:53 -06:00