Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Misc] Miscellaneous code cleanup #4596

Open
wants to merge 8 commits into
base: beta
Choose a base branch
from

Conversation

DayKev
Copy link
Collaborator

@DayKev DayKev commented Oct 6, 2024

What are the changes the user will see?

N/A

Why am I making these changes?

Just purifying some heretical code. 🙏

What are the changes from a developer perspective?

  • Replaced . with #app in overrides.ts imports.
  • Added a missing semicolon and missing explanation comment in eslint.config.js.
  • phases/move-effect-phase.ts:
    • Fix indentation
    • Renamed getTarget to getFirstTarget for clarity.
    • Converted namespace import (Utils) to named imports.
    • Added public/etc to class methods.
  • field/pokemon.ts:
    • Renamed generateVariant() to generateShinyVariant() for clarity.
    • Marked various methods as public/etc.
    • Added tsdocs to isOfType().
    • Updated various tsdocs and comments (and removed an obsolete comment).
    • Cleaned up the monstrosity that was a 450+ line of code (Xavion please...) into something readable.
  • utils.ts:
    • Removed an unused function randSeedEasedWeightedItem().
    • Marked IntegerHolder, FixedInt, and fixedInt() as deprecated.
    • Updated various tsdocs and comments.

How to test the changes?

Play the game normally.

Checklist

  • I'm using beta as my base branch
  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs?
  • Have I provided a clear explanation of the changes?
  • [ ] Have I considered writing automated tests for the issue?
  • [ ] If I have text, did I make it translatable and add a key in the English locale file(s)?
  • Have I tested the changes (manually)?
    • Are all unit tests still passing? (npm run test)
  • [ ] Are the changes visual?
    • [ ] Have I provided screenshots/videos of the changes?

- Update `overrides.ts` imports

- Add missing comment and `;` in `eslint.config.js`

- `field/pokemon.ts`:

Rename `generateVariant` to `generateShinyVariant`

Mark some functions as `public`/etc

Update various tsdocs/comments, add tsdocs to `isOfType`

Turn an unreadable 450+ character line into a
readable block of code

- `utils.ts`:

Remove unused function `randSeedEasedWeightedItem`

Mark `IntegerHolder` and `FixedInt` as deprecated

Update some tsdocs/comments
@DayKev DayKev added Documentation Improvements or additions to documentation Miscellaneous Changes that don't fit under any other label Refactor Rewriting existing code related labels Oct 6, 2024
@DayKev DayKev requested a review from a team as a code owner October 6, 2024 12:09
src/field/pokemon.ts Outdated Show resolved Hide resolved
Rename `getTarget` to `getFirstTarget` for clarity

Convert namespace import to named imports

Add `public`/etc to methods
@DayKev DayKev requested a review from ben-lear October 8, 2024 11:06
Copy link
Collaborator

@MokaStitcher MokaStitcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that move weight calculation killed me

Just have issues with Utils.verifyLang otherwise lgtm

src/utils.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation Miscellaneous Changes that don't fit under any other label Refactor Rewriting existing code related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants