Skip to content

refactor(site): replace !! with Boolean() for boolean coercion#24180

Draft
DanielleMaywood wants to merge 2 commits intomainfrom
dm/replace-double-negation-with-boolean
Draft

refactor(site): replace !! with Boolean() for boolean coercion#24180
DanielleMaywood wants to merge 2 commits intomainfrom
dm/replace-double-negation-with-boolean

Conversation

@DanielleMaywood
Copy link
Copy Markdown
Contributor

🤖 This PR was written by Coder Agent on behalf of Danielle Maywood 🤖

Replaces all !!<variable> double-negation patterns in the frontend with Boolean(<variable>) for explicit boolean coercion.

Two special cases where !! was serving as a type-narrowing mechanism (TypeScript's aliased conditional narrowing):

  • GitPanel.tsx!!remoteDiffStats && remoteDiffStats.additions replaced with remoteDiffStats != null && ... to preserve narrowing.
  • NotificationsPage.tsxconst ready = !!(...data && ...data && ...data) replaced with explicit != null checks to preserve aliased narrowing through the ready variable.
  • TaskPage.tsx.filter((a) => !!a) replaced with .filter(Boolean) which is idiomatic and type-safe in TypeScript 5.5+.

25 files changed, zero !! remaining in site/src.

@github-actions github-actions bot added the community Pull Requests and issues created by the community. label Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Pull Requests and issues created by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant