Skip to content

--json -j should not use color#7069

Draft
dmerand wants to merge 1 commit intomainfrom
dlm-json-force-no-color
Draft

--json -j should not use color#7069
dmerand wants to merge 1 commit intomainfrom
dlm-json-force-no-color

Conversation

@dmerand
Copy link
Contributor

@dmerand dmerand commented Mar 20, 2026

What

Disable color output automatically when a command runs in JSON mode.

This makes --json and -j behave like --no-color at CLI bootstrap.

Why

Machine-readable output should not depend on terminal styling.

Without this, ANSI escape sequences can leak into JSON string values unless callers also remember to pass --no-color.

How

Treat --json and -j as no-color signals when the CLI sets up its environment.

Testing

Run a JSON-mode command such as shopify app validate --json ... and confirm the JSON output does not contain ANSI escape sequences without also passing --no-color.

@dmerand dmerand mentioned this pull request Mar 20, 2026
Copy link
Contributor Author

dmerand commented Mar 20, 2026

@github-actions
Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 82.21% 14927/18157
🟡 Branches 74.64% 7394/9906
🟢 Functions 81.36% 3767/4630
🟢 Lines 82.61% 14114/17086

Test suite run success

3912 tests passing in 1502 suites.

Report generated by 🧪jest coverage report action from 91c5478

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