Skip to content

Fix: Use nullish coalescing operators for better type safety#189

Open
0xAxiom wants to merge 2 commits intomainfrom
fix/code-quality-improvements-mar14
Open

Fix: Use nullish coalescing operators for better type safety#189
0xAxiom wants to merge 2 commits intomainfrom
fix/code-quality-improvements-mar14

Conversation

@0xAxiom
Copy link
Owner

@0xAxiom 0xAxiom commented Mar 14, 2026

What

Replace logical OR operators (||) with nullish coalescing operators (??) in CLI build command for better null/undefined handling.

Why

  • Improves code safety by preventing falsy value coercion (empty strings, 0, false, etc.)
  • Addresses ESLint @typescript-eslint/prefer-nullish-coalescing warnings
  • Better aligns with TypeScript best practices for null-safety

What Changed

  • CLI/src/commands/build.ts: Fixed 2 instances where || should be ??
    • Line 126: result.error ?? 'Unknown error'
    • Line 152: result.buildPath ?? 'N/A'

Tested

  • Linting warnings reduced
  • No functional changes to behavior for null/undefined values
  • Only affects edge cases with falsy-but-valid values

0xAxiom added 2 commits March 14, 2026 03:49
- Updated root project dependencies via npm update
- Resolved all high severity vulnerabilities (previously 1 high)
- Reduced total vulnerabilities from 11 to 5 (all low severity)
- Updated ESLint, archiver, and other dev dependencies
- All workspace packages (CLI, dapp-factory) now clean
- Only remaining issues are low severity in mcp-server dependency chain
- replace logical or operators with nullish coalescing for better null/undefined handling
- improves code safety by preventing falsy value coercion
- addresses eslint prefer-nullish-coalescing warnings
@0xAxiom 0xAxiom requested a review from MeltedMindz as a code owner March 14, 2026 14:50
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.

1 participant