Skip to content

[rush] rush alert should honor -q and --json and similar #5228

Open

Description

Summary

When rush alerts is used, utilities that rely on output could fail if the alert is triggered. shouldRestrictConsoleOutput should probably be honored on rush alerts.

Repro steps

run any command that relies on output, like rush list --json | jq

Expected result:
Only JSON should be written to STDOUT

Actual result:
Rush alerts are written to stdout, resulting in an error

jq: parse error: Invalid numeric literal at line 4015, column 0

Details

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/rush globally installed version? 5.153.1
rushVersion from rush.json? 5.153.1
useWorkspaces from rush.json? undefined
Operating system? Mac / Linux
Would you consider contributing a PR? No
Node.js version (node -v)? 22.14.0

Activity

  1. iclanton commented on May 28, 2025

    @iclanton
    Member

    Looks like this was an oversight when that feature was implemented. Should be a fairly easy fix.

  2. moved this from Needs triage to Low priority in Bug Triageon May 28, 2025
  3. added
    help wantedIf you're looking to contribute, this issue is a good place to start!
    effort: easyProbably a quick fix. Want to contribute? :-)
    on May 28, 2025
  4. AryanBagade commented on Sep 3, 2025

    @AryanBagade

    Hi! Ian Clanton-Thuon (@iclanton) I’d like to take this issue, could you please assign it to me?

    Proposed approach:

    Rationale:

    • Prevents alert output on stdout so commands like rush list --json | jq emit only JSON.
    • Keeps explicit rush alert behavior unchanged.

    Tests:

    • Add/extend a test to assert no alert output when --json or -q is present, and JSON remains valid.

    If this direction looks good, I’ll proceed from branch fix/5228-alert-honor-quiet-json. Thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort: easyProbably a quick fix. Want to contribute? :-)help wantedIf you're looking to contribute, this issue is a good place to start!

    Type

    No type

    Projects

    • Status
      Low priority

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions