Skip to content

fix(core,cli): improve lint output - JSON flag, info/warning counts, severity display#134

Merged
miguel-heygen merged 7 commits intomainfrom
fix/lint-improvements
Mar 31, 2026
Merged

fix(core,cli): improve lint output - JSON flag, info/warning counts, severity display#134
miguel-heygen merged 7 commits intomainfrom
fix/lint-improvements

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

@miguel-heygen miguel-heygen commented Mar 30, 2026

Summary

  • Respect --json flag on all lint exit paths so agents always get machine-readable output
  • Separate infoCount from warningCount in linter results (was conflated)
  • Display info vs warning severity distinctly in lint output

When lint encountered an error (e.g., invalid directory), it output
plain text even with --json, breaking JSON parsing pipelines for
agents. Now wraps the entire lint command in try-catch that emits
JSON errors when --json is set.

Reproducer:
  npx hyperframes lint --json /nonexistent/path
  # Was: plain text "Not a directory: /nonexistent/path"
  # Now: {"ok": false, "error": "Not a directory: /nonexistent/path", ...}
The linter was computing warningCount as findings.length - errorCount,
which lumped info-severity findings into the warning count. Now counts
warnings and infos separately, and adds a new infoCount field.

Reproducer:
  # Create composition with timed element missing class="clip"
  npx hyperframes lint        # Was: "0 errors, 1 warning(s)"
  npx hyperframes lint --json # Was: severity: "info" but warningCount: 1
  # Now warningCount: 0, infoCount: 1
The lint command displayed info-level findings with the warning icon
and counted them in the warning total, while JSON correctly reported
severity as "info". Now info findings show a distinct icon (ℹ) and
are counted separately in both human and JSON output.

Reproducer:
  # Create a composition with a timed element missing class="clip"
  npx hyperframes lint        # Was: "1 warning(s)" with ⚠ icon
  npx hyperframes lint --json # Was: severity: "info" but warningCount: 1
  # Human and JSON output now agree
@miguel-heygen miguel-heygen changed the title fix(core,cli): improve lint output — JSON flag, info/warning counts, severity display fix(core,cli): improve lint output - JSON flag, info/warning counts, severity display Mar 30, 2026
Resolve conflict in lint.ts: keep main's lintProject/formatLintFindings
refactoring, integrate PR's infoCount tracking, filesScanned in JSON
output, info severity display, and try/catch error handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@miguel-heygen can we hide info by default? I think we should only show when --verbose or --log-level something

only show warnings/errors, infos are noisey/aren't needed by agents right?

miguel-heygen and others added 2 commits March 31, 2026 02:05
Info findings are noisy for agents and day-to-day use. Only errors and
warnings are shown by default. Pass --verbose to include info findings
in both CLI and JSON output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…severity levels

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@miguel-heygen miguel-heygen merged commit 1aca29a into main Mar 31, 2026
22 checks passed
Copy link
Copy Markdown
Collaborator Author

Merge activity

miguel-heygen added a commit that referenced this pull request Mar 31, 2026
…severity display (#134)

## Summary

- Respect `--json` flag on all lint exit paths so agents always get machine-readable output
- Separate `infoCount` from `warningCount` in linter results (was conflated)
- Display `info` vs `warning` severity distinctly in lint output
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.

2 participants