Skip to content

strict bools#82

Open
ironm00n wants to merge 1 commit intomasterfrom
strict-bool
Open

strict bools#82
ironm00n wants to merge 1 commit intomasterfrom
strict-bool

Conversation

@ironm00n
Copy link
Member

@ironm00n ironm00n commented Jul 3, 2025

No description provided.

@ironm00n ironm00n requested a review from Copilot July 3, 2025 17:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 !value or value.
  • Add ESLint @typescript-eslint/strict-boolean-expressions rule 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 using guild.members.cache.get(...). Consider moving the null check before accessing guild, 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 default branch that logs or handles unexpected data.t values to improve maintainability.
		// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants