Skip to content

fix(lint): print the version and usage instead of a parseArgs error - #444

Merged
vite-hub[bot] merged 1 commit into
mainfrom
fix/lint-cli-version
Nov 17, 2026
Merged

vite-hub[bot] merged 1 commit into
mainfrom
fix/lint-cli-version

Conversation

@onmax

@onmax onmax commented Nov 17, 2026

Copy link
Copy Markdown
Owner

lint-comark --version crashes with Node's TypeError [ERR_PARSE_ARGS_UNKNOWN_OPTION] and a stack trace, and so does any mistyped option such as --formt.

cli.ts calls parseArgs in strict mode with no version option and doesn't catch its errors. This adds --version and -v, which print the package version and exit 0. A parse error now prints one line to stderr, such as comark-lint: Unknown option '--bogus'., then the usage, and exits 2, the same code as an unknown --format. The CLI reference in docs/getting-started.md lists the new option and the exit code.

The new test in packages/lint/test/lint.test.ts runs the built CLI with --version, -v and --bogus. It fails on main with the parseArgs error and passes here. The lint tests, typecheck, vp check, the linter Doctor and lint:docs pass.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T00:18:25.776816Z
We couldn’t complete this review. Comment @codex review to try again.
5479e40 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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: --version and -v print 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.

Pullfrog  | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@444

comark-badge

pnpm add https://pkg.pr.new/comark-badge@444

comark-bundle

pnpm add https://pkg.pr.new/comark-bundle@444

comark-cards

pnpm add https://pkg.pr.new/comark-cards@444

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@444

comark-cast

pnpm add https://pkg.pr.new/comark-cast@444

comark-charts

pnpm add https://pkg.pr.new/comark-charts@444

comark-chat

pnpm add https://pkg.pr.new/comark-chat@444

comark-chips

pnpm add https://pkg.pr.new/comark-chips@444

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@444

comark-code

pnpm add https://pkg.pr.new/comark-code@444

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@444

comark-colors

pnpm add https://pkg.pr.new/comark-colors@444

comark-comments

pnpm add https://pkg.pr.new/comark-comments@444

comark-critic

pnpm add https://pkg.pr.new/comark-critic@444

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@444

comark-details

pnpm add https://pkg.pr.new/comark-details@444

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@444

comark-diff

pnpm add https://pkg.pr.new/comark-diff@444

comark-embed

pnpm add https://pkg.pr.new/comark-embed@444

comark-fields

pnpm add https://pkg.pr.new/comark-fields@444

comark-figure

pnpm add https://pkg.pr.new/comark-figure@444

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@444

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@444

comark-git-graph

pnpm add https://pkg.pr.new/comark-git-graph@444

comark-github

pnpm add https://pkg.pr.new/comark-github@444

comark-icon

pnpm add https://pkg.pr.new/comark-icon@444

comark-include

pnpm add https://pkg.pr.new/comark-include@444

comark-keys

pnpm add https://pkg.pr.new/comark-keys@444

comark-links

pnpm add https://pkg.pr.new/comark-links@444

comark-linter

pnpm add https://pkg.pr.new/comark-linter@444

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@444

comark-mark

pnpm add https://pkg.pr.new/comark-mark@444

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@444

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@444

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@444

comark-media

pnpm add https://pkg.pr.new/comark-media@444

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@444

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@444

comark-outline

pnpm add https://pkg.pr.new/comark-outline@444

comark-properties

pnpm add https://pkg.pr.new/comark-properties@444

comark-qr

pnpm add https://pkg.pr.new/comark-qr@444

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@444

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@444

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@444

comark-sources

pnpm add https://pkg.pr.new/comark-sources@444

comark-steps

pnpm add https://pkg.pr.new/comark-steps@444

comark-table

pnpm add https://pkg.pr.new/comark-table@444

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@444

comark-tests

pnpm add https://pkg.pr.new/comark-tests@444

comark-time

pnpm add https://pkg.pr.new/comark-time@444

comark-ui

pnpm add https://pkg.pr.new/comark-ui@444

comark-xref

pnpm add https://pkg.pr.new/comark-xref@444

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@444

commit: 5479e40

@vite-hub
vite-hub Bot merged commit 415e0af into main Nov 17, 2026
6 checks passed
@vite-hub
vite-hub Bot deleted the fix/lint-cli-version branch November 17, 2026 00:29
@github-actions github-actions Bot mentioned this pull request Nov 16, 2026
@vite-hub

vite-hub Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

@github-actions github-actions Bot mentioned this pull request Nov 17, 2026
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