Repository navigation
fix(lint): print the version and usage instead of a parseArgs error - #444
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain.
Reviewed changes — Reviewed the CLI argument handling, built-package behavior, documentation, and regression coverage across all three changed files.
- Version output:
--versionand-vprint the package version and exit successfully before configuration or file processing. - Argument errors: Strict parsing failures now produce a diagnostic and usage text with exit code
2, rather than an uncaught stack trace. - Documentation and tests: The CLI reference documents the new flags and error behavior, and built-CLI tests cover both version aliases and unknown options. The workspace build, typecheck, targeted lint, all 57 tests in
packages/lint/test/lint.test.ts, and additional CLI smoke checks passed.
gpt-6.1-sol(xhigh) | 𝕏
comark-annotate
comark-badge
comark-bundle
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-git-graph
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
Latest result Pull request merged. Final answersSession Pull request merged. |

lint-comark --versioncrashes with Node'sTypeError [ERR_PARSE_ARGS_UNKNOWN_OPTION]and a stack trace, and so does any mistyped option such as--formt.cli.tscallsparseArgsin strict mode with noversionoption and doesn't catch its errors. This adds--versionand-v, which print the package version and exit 0. A parse error now prints one line to stderr, such ascomark-lint: Unknown option '--bogus'., then the usage, and exits 2, the same code as an unknown--format. The CLI reference indocs/getting-started.mdlists the new option and the exit code.The new test in
packages/lint/test/lint.test.tsruns the built CLI with--version,-vand--bogus. It fails onmainwith the parseArgs error and passes here. The lint tests, typecheck,vp check, the linter Doctor andlint:docspass.🤖 Generated with Claude Code