Skip to content

feat: Add silent option to checkHotkey to suppress console output#3

Open
solssak wants to merge 1 commit intoTanStack:mainfrom
solssak:feat-silent-console-logging
Open

feat: Add silent option to checkHotkey to suppress console output#3
solssak wants to merge 1 commit intoTanStack:mainfrom
solssak:feat-silent-console-logging

Conversation

@solssak
Copy link

@solssak solssak commented Feb 6, 2026

🎯 Changes

This PR adds a silent option to the checkHotkey() function to suppress console output in production environments.
Motivation:
Currently, checkHotkey() always logs validation warnings and errors to the console with no way to suppress them. This can clutter production logs, and developers have no control over this behavior.
What changed:

  • Added optional options parameter to checkHotkey() with a silent boolean property
  • When silent: true, console.warn() and console.error() calls are suppressed
  • Updated JSDoc documentation with usage examples
  • Added 3 comprehensive tests to verify the silent option works correctly
    API Example:
    // Before (still works - backward compatible)
    checkHotkey(Alt+C) // Logs to console
    // New option
    checkHotkey(Alt+C, { silent: true }) // No console output
    Testing:
  • ✅ All 161 tests pass (including 3 new tests for silent option)
  • ✅ Type checking passes
  • ✅ Fully backward compatible (no breaking changes)

✅ Checklist

🚀 Release Impact

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