Skip to content

Fix up linting errors found by the new js-lint #37

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

Merged
merged 2 commits into from
May 14, 2025

Conversation

CDeltakai
Copy link
Contributor

@CDeltakai CDeltakai commented May 14, 2025

Description

This is a small PR that simply fixes up some of the linting errors discovered by the new js-lint.

Issues Fixed

Tasks

  • 1. Fix up any linting errors found by the new js-lint package.

Final checklist

  • Domain specific tests
  • Full tests
  • Updated inline-comment documentation
  • Lint fixed
  • Squash and rebased
  • Sanity check the final build

@CDeltakai CDeltakai self-assigned this May 14, 2025
@CDeltakai
Copy link
Contributor Author

CDeltakai commented May 14, 2025

RWLockReader.ts and RWLockWriter.ts contained a few conditional branches that were unreachable. These branches were trying to equate typeof to null, which would always end up false because typeof always returned a string.

However, seeing as this branch has never been executed, and no problems have arisen from it not executing for a long time, the simplest solution was just to remove the branches entirely to preserve identical functionality.

…ith void LockBox and Monitor because we only care about side effects
@CDeltakai
Copy link
Contributor Author

In Lockbox.ts and Monitor.ts, the waitPs array is reversed with the reverse() method in the waitForUnlock method. This returns a PromiseCancellable<void>[], however that promise is never handled in any way which causes a linting error for no-floating-promises.

However, in this case it seems that we are only interested in the side-effect of reverse() and there is nothing to do with the returned promise anyway, therefore the most logical solution would be to explicitly ignore the returned promise with void.

@CDeltakai CDeltakai merged commit 64ca8f4 into staging May 14, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant