Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR tightens boolean expressions across the codebase by replacing loose truthy/falsy checks with explicit nullish checks or strict comparisons and updates ESLint rules to enforce strict boolean expressions.
- Enforce
===,!==or nullish checks (== null) instead of!valueorvalue. - Add ESLint
@typescript-eslint/strict-boolean-expressionsrule and disable unnecessary boolean casts. - Update dozens of conditionals and assertions to satisfy the new strict-boolean-expressions linting.
Reviewed Changes
Copilot reviewed 133 out of 133 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/tasks/feature/removeExpiredPunishements.ts | Changed assert(guild) to assert(guild != null) |
| src/tasks/feature/handleReminders.ts | Added ESLint disable for no-misused-promises |
| src/listeners/ws/dispatch.ts | Marked _shardId as unused and disabled exhaustiveness |
| eslint.config.js | Enabled @typescript-eslint/strict-boolean-expressions and related rules |
Comments suppressed due to low confidence (3)
src/tasks/feature/removeExpiredPunishements.ts:35
- The
assert(guild != null)is placed after usingguild.members.cache.get(...). Consider moving the null check before accessingguild, or handle the null case explicitly to avoid potential runtime errors.
assert(guild != null);
src/tasks/feature/handleReminders.ts:32
- [nitpick] Instead of disabling the lint rule for the entire block, consider wrapping the async callback in a named function or using
.catch()on the promise to satisfy the linter and document error handling more explicitly.
// eslint-disable-next-line @typescript-eslint/no-misused-promises
src/listeners/ws/dispatch.ts:22
- Disabling switch-exhaustiveness-check suppresses missing-case warnings. Consider adding a
defaultbranch that logs or handles unexpecteddata.tvalues to improve maintainability.
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.